The HPREDUCE Procedure
Example 9.1 Select Variables
This example first generates a data set, which has 2,000 observations and contains both interval variables (x1–x10) and CLASS variables (b1–b3, c1–c10). Then PROC HPREDUCE is run to select variables.
data one;
array x{10};
array c{10};
do i=1 to 2000;
do j=1 to 10;
x{j}=ranuni(1);
c{j}=int(ranuni(1)*4);
end;
if c{1} eq 0 then b1 = 'aa';
if c{1} eq 1 then b1 = 'bb';
if c{1} eq 2 then b1 = 'cc';
if c{1} eq 3 then b1 = 'dd';
if c{1} eq 4 then b1 = 'ee';
if c{2} eq 0 then b2 = 'ff';
if c{2} eq 1 then b2 = 'gg';
if c{2} eq 2 then b2 = 'hh';
if c{2} eq 3 then b2 = 'ii';
if c{2} eq 4 then b2 = 'jj';
if c{3} eq 0 then b3 = 'kk';
if c{3} eq 1 then b3 = 'll';
if c{3} eq 2 then b3 = 'mm';
if c{3} eq 3 then b3 = 'nn';
if c{3} eq 4 then b3 = 'oo';
output;
end;
run;
ods listing;
proc hpreduce data=one;
class b1-b3 c1-c3;
reduce unsupervised b1 b1*b2 b3 c1-c3 x1-x10/maxsteps=5;
performance details;
run;
Output 9.1.1 shows that the PROC HPREDUCE ran locally and that four threads were used.
Output 9.1.1: PROC HPREDUCE Running in Single-Machine Mode
The HPREDUCE Procedure
| Performance Information | |
|---|---|
| Execution Mode | Single-Machine |
| Number of Threads | 16 |
| Data Access Information | |||
|---|---|---|---|
| Data | Engine | Role | Path |
| WORK.ONE | V9 | Input | On Client |
| Model Information | |
|---|---|
| Data Source | ONE |
| Model Type | Unsupervised |
| Class Parameterization | GLM |
| Selection Technique | Variance Analysis |
| Number of Variables | 16 |
| Maximal Number of Steps | 5 |
| Number of Observations Read | 2000 |
|---|---|
| Number of Observations Used | 2000 |
| Class Level Information | ||
|---|---|---|
| Class | Levels | Values |
| b1 | 4 | aa bb cc dd |
| b2 | 4 | ff gg hh ii |
| b3 | 4 | kk ll mm nn |
| c1 | 4 | 0 1 2 3 |
| c2 | 4 | 0 1 2 3 |
| c3 | 4 | 0 1 2 3 |
| Selection Summary | ||||||||
|---|---|---|---|---|---|---|---|---|
| Iteration | Selected Effect | Level | Proportion of Variance Explained | SSE | MSE | AIC | AICC | BIC |
| 1 | b1 | cc | 0.0821 | 42.2236 | 0.0211 | 4.8230 | 49.8490 | 3.7468 |
| 2 | b1 | bb | 0.1637 | 38.4694 | 0.0193 | 4.7279 | 48.7538 | 3.6575 |
| 3 | b1 | aa | 0.2443 | 34.7635 | 0.0174 | 4.6236 | 47.6494 | 3.5600 |
| 4 | b3 | kk | 0.3036 | 32.0323 | 0.0160 | 4.5377 | 46.5635 | 3.4819 |
| 5 | b3 | mm | 0.3619 | 29.3519 | 0.0147 | 4.4454 | 45.4710 | 3.3984 |
| Selected Variables | ||
|---|---|---|
| Number | Selected Variable | Variable Type |
| 1 | b1 | CLASS |
| 2 | b3 | CLASS |
| Procedure Task Timing | ||
|---|---|---|
| Task | Seconds | Percent |
| Data Read and Variable levelization | 0.03 | 13.33% |
| Effect Levelization | 0.00 | 0.96% |
| Data Preparation for Discriminant Analysis | 0.00 | 0.00% |
| Cross-product Accumulation | 0.17 | 64.82% |
| Variable Selection | 0.05 | 20.89% |
Last updated: May 25, 2022