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

The HPSVM Procedure

Performance Information
Execution ModeSingle-Machine
Number of Threads4


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 TypeC_CLAS
Optimization TechniqueInterior Point
ScaleYES
Kernel FunctionLinear
Penalty MethodC
Penalty Parameter1
Maximum Iterations25
Tolerance1e-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 Read5960
Number of Observations Used3364


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
PenaltyTrue
Positive
True
Negative
False
Negative
False
Positive
MisclassificationAccuracy
0.50000031305826962750.9183
1.00000032305826862740.9185
5.00000032305826862740.9185
10.0000032305826862740.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 Weights19.8000318
Bias-1.5372926
Total Slack (Constraint Violations)532.92348
Norm of Longest Vector2.72195233
Number of Support Vectors3361
Number of Support Vectors on Margin267
Maximum F1.0000874
Minimum F-2.9999943
Number of Effects12
Columns in Data Matrix49


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
ObservedTraining Prediction
10Total
143257300
0930553064
Total5233123364


The "Fit Statistics" table in Figure 11 shows information about the accuracy, error, sensitivity, and specificity.

Figure 11: PROC HPSVM Fit Statistics

Fit Statistics
StatisticTraining
Accuracy0.9209
Error0.0791
Sensitivity0.1433
Specificity0.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.

Last updated: May 25, 2022