The SEMISUPLEARN Procedure

Example 21.1 German Credit Benchmark Data

This example applies the semisupervised learning algorithm to German credit benchmark data, which are available in the Sampsio.dmagecr data set. This data set contains 1,000 observations, each of which contains an applicant’s information, including the applicant’s credit rating (good or bad). The binary target is named GOOD_BAD. The other input variables are Duration, Amount, InstallP, Resident, and Existcr.

The following statements load the unlabeled data table with 800 observations and the labeled data table with 50 observations:


data mycas.dmagecrunlabel(drop=good_bad);
   set sampsio.dmagecr(obs=800);
   id=_N_;
run;


data mycas.dmagecrlabel;
set sampsio.dmagecr(obs=50);
run;

The following statements run the SEMISUPLEARN procedure on the unlabeled data table mycas.dmagecrUnlabel and the labeled data table mycas.dmagecrLabel:

proc semisuplearn data=mycas.dmagecrunlabel label=mycas.dmagecrlabel;
   input duration amount installp resident existcr;
   kernel KNN/k=5;
   output out      = mycas.out copyvars=(amount installp id);

   target good_bad;
run;


Output 21.1.1 shows the number of unlabeled observations, number of labeled observations, number of levels for the target variable, gamma value, maximum number of iterations, kernel used in the computation, number of nearest neighbors and the loss.

Output 21.1.1: Model Information

The SEMISUPLEARN Procedure

Model Information
Labeled Observations Used50
Unlabeled Observations Used800
Maximum Iterations3
Target Number of Levels2
Gamma20
Nearest Neighbors5
Kernel FunctionKNN

Loss
23.189249

Output CAS Tables
CAS LibraryNameNumber
of Rows
Number
of Columns
CASUSERHDFS(tiarno)OUT8505


The following statements sort the output of PROC SEMISUPLEARN by id and show the observations from 110 to 118:

data out2; set mycas.out; run;
proc sort data=out2; by id; run;
proc print data=out2(firstobs=110 obs=118);
run;

Output 21.1.2 shows the values of the amount, installp, and id variables; the predicted labels for the nine observations; and the indicators for the labeled or unlabeled data.

Output 21.1.2: CAS Output

ObsamountinstallpidI_good_bad_WARN_
1106229460bad0
1111391261bad0
1121537462good0
1131953463good0
11414421264bad0
1153181465good0
1165190466good0
1172171267good0
1181007468good0


Last updated: May 08, 2023