The HPSVM Procedure
Example 10.1 Interior Point Method
This example shows how you can use PROC HPSVM to train a mode by using the default interior point method.
The following statements show the basic usage:
proc hpsvm data=sampsio.hmeq;
input reason job derog delinq ninq / level=nominal;
input loan mortdue value yoj clage clno debtinc / level=interval;
target bad / order=desc;
penalty C=0.5 1 5 10;
select fold=3 CV=SPLIT;
code file="scorecode.sas";
run;
PROC HPSVM generates several ODS tables, some of which are shown in Figure 5 through Figure 11.
The "Performance Information" table in Figure 5 shows the running environment information: PROC HPSVM runs on a single machine, and the number of threads is 4.
Figure 5: PROC HPSVM Performance Information
| Performance Information | |
|---|---|
| Execution Mode | Single-Machine |
| Number of Threads | 4 |
The "Model Information" table in Figure 6 shows the user settings: the kernel function is linear, and the penalty parameter value C is 1.
Figure 6: PROC HPSVM Model Information
| Model Information | |
|---|---|
| Task Type | C_CLAS |
| Optimization Technique | Interior Point |
| Scale | YES |
| Kernel Function | Linear |
| Penalty Method | C |
| Penalty Parameter | 1 |
| Maximum Iterations | 25 |
| Tolerance | 1e-06 |
The observations table in Figure 7 shows that the total number of observations is 5,960 and the number of observations used in the training is 3,364.
Figure 7: PROC HPSVM Observations
| Number of Observations Read | 5960 |
|---|---|
| Number of Observations Used | 3364 |
The "Penalty Selection" table in Figure 8 shows the statistics of the cross validation result for each penalty. In the table, the best accuracy is 0.9185; thus the best penalty value is 1.
Figure 8: PROC HPSVM Penalty Selection
| Penalty Selection | ||||||
|---|---|---|---|---|---|---|
| Cross-Validation, Fold=3, Best C=1 | ||||||
| Penalty | True Positive | True Negative | False Negative | False Positive | Misclassification | Accuracy |
| 0.500000 | 31 | 3058 | 269 | 6 | 275 | 0.9183 |
| 1.000000 | 32 | 3058 | 268 | 6 | 274 | 0.9185 |
| 5.000000 | 32 | 3058 | 268 | 6 | 274 | 0.9185 |
| 10.00000 | 32 | 3058 | 268 | 6 | 274 | 0.9185 |
The "Training Results" table in Figure 9 shows the inner product of weights, bias, total slack, and so on.
Figure 9: PROC HPSVM Training Results
| Training Results | |
|---|---|
| Inner Product of Weights | 19.8000318 |
| Bias | -1.5372926 |
| Total Slack (Constraint Violations) | 532.92348 |
| Norm of Longest Vector | 2.72195233 |
| Number of Support Vectors | 3361 |
| Number of Support Vectors on Margin | 267 |
| Maximum F | 1.0000874 |
| Minimum F | -2.9999943 |
| Number of Effects | 12 |
| Columns in Data Matrix | 49 |
The "Classification Matrix" table in Figure 10 displays the original observations and predicted values. Here the true positive is 43, and the false negative is 257. The true negative is 3,055, and the false positive is 9.
Figure 10: PROC HPSVM Classification Matrix
| Classification Matrix | |||
|---|---|---|---|
| Observed | Training Prediction | ||
| 1 | 0 | Total | |
| 1 | 43 | 257 | 300 |
| 0 | 9 | 3055 | 3064 |
| Total | 52 | 3312 | 3364 |
The "Fit Statistics" table in Figure 11 shows information about the accuracy, error, sensitivity, and specificity.
Figure 11: PROC HPSVM Fit Statistics
| Fit Statistics | |
|---|---|
| Statistic | Training |
| Accuracy | 0.9209 |
| Error | 0.0791 |
| Sensitivity | 0.1433 |
| Specificity | 0.9971 |
In addition to these ODS tables, PROC HPSVM also generates tables such as "Iteration History" and "Procedure Task Timing." In this example, PROC HPSVM generates SAS code scorecode.sas. Advanced SAS Enterprise Miner users can easily score their data with the SAS code.