KPCA Procedure

PREIMAGE Statement

  • PREIMAGE <options>;

The PREIMAGE statement specifies the pre-image method and any associated parameters to use during training. For more information about pre-image methods, see the sections KPCA Iterative Pre-image Method and KPCA Mapping Pre-image Method. You can specify the following options:

METHOD=MAP(<options>) | ITERATIVE

specifies the method to use for pre-image training. You can specify one of the following values:

ITERATIVE

uses the iterative method to find the pre-image.

MAP(<options>)

uses the mapping method to find the pre-image. You can specify the following options:

CENTROIDSPC=libref.data-table

specifies the name of the output table to contain the centroids of the points in the principal component space that are generated by k-means clustering. This table is generated when you specify METHOD=APPROXIMATE in the PROC KPCA statement. libref.data-table is a two-level name, where libref refers to the library, and data-table specifies the name of the output data table. For more information about this two-level name, see the DATA= option and the section Using SAS Viya Workbench.

KERNEL=LINEAR | POLYNOMIAL(<options>) | RBF(<option>)

specifies the kernel type for the kernel ridge regression to be used in the mapping method. You can specify one of the following options:

LINEAR

uses a linear kernel for the kernel ridge regression in the mapping method.

POLYNOMIAL(DEGREE=number INTERCEPT=number)

specifies that the kernel type in the kernel ridge regression of the mapping method is in the polynomial form. The degree of the polynomial is a positive integer value that is specified in the DEGREE= option. By default, DEGREE=3. The intercept is a numeric value that is specified in the INTERCEPT= option. By default, INTERCEPT=1.

RBF(BW=number)

uses a radial basis function (also known as the Gaussian kernel function) in the kernel ridge regression of the mapping method. The kernel is defined as

where x and y are vectors and s is the bandwidth parameter. You can specify the bandwidth parameter in the form BW=s, where s is a positive nonzero real number. The processing time usually increases as the value of s decreases. At very small values of s, the processing time can be very long.

By default, the bandwidth parameter value is , where n is the number of rows in the training data set. The default value of the BW= option is calculated in the same way as the value described in the KERNEL statement. Note that the default parameter is not guaranteed to produce good results. It is recommended that you tune this parameter by using some systematic approach, such as cross validation.

L2=number

specifies a numeric value for the L2 regularization parameter of the kernel ridge regression to be used in the mapping method. By default, L2=1.

MAPCOEFFS=libref.data-table

specifies the name of the output table to contain the coefficients of the pre-image mapping method. libref.data-table is a two-level name, where libref refers to the library, and data-table specifies the name of the output data table. For more information about this two-level name, see the DATA= option and the section Using SAS Viya Workbench.

By default, METHOD=ITERATIVE.

NPC=number

specifies a positive integer value as the number of principal components to use in pre-image training. For the mapping method, it is also the number of principal components to use in pre-image scoring.

Last updated: September 23, 2026