The HPBIN Procedure

Example 4.3 Quantile Binning in Distributed Mode

This example shows quantile binning that is executed in distributed mode. Most of this example is the same as the pseudo–quantile binning example (see Example 4.2 Pseudo–Quantile Binning in Distributed Mode,), so you can easily compare these two binning methods. The following DATA step generates 1,000,000 observations:

    data ex12;
        length id 8;
        do id=1 to 1000000;
            x1 = ranuni(101);
            x2 = 10*ranuni(201);
            output;
        end;
    run;
    

You can run PROC HPBIN in distributed mode by specifying valid values for the NODES=, INSTALL=, and HOST= options in the PERFORMANCE statement. An alternative to specifying the INSTALL= and HOST= options in the PERFORMANCE statement is to set appropriate values for the GRIDHOST and GRIDINSTALLLOC environment variables by using OPTIONS SET commands. See the section Processing Modes in Chapter 3: Shared Concepts and Topics, for details about setting these options or environment variables.

The following statements provide an example. To run these statements successfully, you need to set the macro variables GRIDHOST and GRIDINSTALLLOC to resolve to appropriate values, or you can replace the references to macro variables with appropriate values.

 ods output BinInfo=bininfo;
 ods output PerformanceInfo=perfInfo;
 ods output Mapping=mapTable;
 ods listing close;
 proc hpbin data=ex12 output=out numbin=10 quantile;
     input x1-x2;
     performance nodes=4 nthreads=8
     host="&GRIDHOST" install="&GRIDINSTALLLOC";
 run;
 ods listing;

The "Performance Information" table in Output 4.3.1 shows the grid setting.

Output 4.3.1: PROC HPBIN Performance Information

Performance Information
Host Node << your grid host >>
Install Location << your grid install location >>
Execution Mode Distributed
Grid Mode Symmetric
Number of Compute Nodes 4
Number of Threads per Node 8



The "Binning Information" table in Output 4.3.2 shows the binning method, number of bins, and number of variables.

Output 4.3.2: PROC HPBIN Binning Information

Binning Information
Method Quantile Binning
Number of Bins Specified 10
Number of Variables 2



The "Mapping" table in Output 4.3.3 shows the level mapping of the input variables. As you can see from this table, when the binning method is quantile, PROC HPBIN assigns the same number of observations to each bin for the input variables if possible.

Output 4.3.3: PROC HPBIN Mapping

Mapping
Variable Binned Variable Range Frequency Proportion
x1 BIN_x1 x1 < 0.099859 100000 0.10000000
    0.099859 <= x1 < 0.199413 100000 0.10000000
    0.199413 <= x1 < 0.299210 100000 0.10000000
    0.299210 <= x1 < 0.399472 100000 0.10000000
    0.399472 <= x1 < 0.499913 100000 0.10000000
    0.499913 <= x1 < 0.599746 100000 0.10000000
    0.599746 <= x1 < 0.700361 100000 0.10000000
    0.700361 <= x1 < 0.800231 100000 0.10000000
    0.800231 <= x1 < 0.900236 100000 0.10000000
    0.900236 <= x1 100000 0.10000000
x2 BIN_x2 x2 < 0.996924 100000 0.10000000
    0.996924 <= x2 < 1.994716 100000 0.10000000
    1.994716 <= x2 < 2.993747 100000 0.10000000
    2.993747 <= x2 < 3.994634 100000 0.10000000
    3.994634 <= x2 < 4.998520 100000 0.10000000
    4.998520 <= x2 < 5.997022 100000 0.10000000
    5.997022 <= x2 < 6.992673 100000 0.10000000
    6.992673 <= x2 < 7.998557 100000 0.10000000
    7.998557 <= x2 < 8.999391 100000 0.10000000
    8.999391 <= x2 100000 0.10000000