CRITERIA Subcommand (KNN command)

The CRITERIA subcommand specifies computational and resource settings for the KNN procedure.

NUMFEATURES Keyword

The NUMFEATURES keyword specifies how automatic feature selection should select the number of features.

This keyword is ignored if /MODEL FEATURES=AUTO is not in effect.

AUTO. Select a fixed number of features, where the number of features is computed from a formula. The number of features the procedure selects is equal to min(20,P) - J Forced, where P is the total number of features and J Forced is the number of forced features. This is the default.

FIXED (integer). Select a fixed number of features, where the number of features is specified in advance. Specify a positive integer. It must be less than or equal to the number of unique predictors available for feature selection. This will be the number of predictors specified on the KNN command, minus any specified on the EXCEPT subcommand, minus any forced into the model.

ERRORRATIO (MINCHANGE=value). Select features until the absolute change in the error ratio compared to the previous step is less than the criterion value. Specify a number greater than 0. The default value is 0.01.

PREDICTED Keyword

The PREDICTED keyword specifies the function used to compute the predicted value of scale response variables.

This keyword is ignored if no dependent variable is specified.

MEAN. Compute predicted values based upon the mean value of the nearest neighbors. This is the default.

MEDIAN. Compute predicted values based upon the median value of the nearest neighbors.

WEIGHTFEATURES Keyword

The WEIGHTFEATURES keyword specifies whether to weight features by their normalized importance when computing distances.

NO. Do not weight features by normalized importance. This is the default.

YES. Weight features by normalized importance. Feature importance for a predictor is calculated by the ratio of the error rate or sum-of-squares error of the model with the predictor removed from the model to the error rate or sum-of-squares error for the full model. Normalized importance is calculated by reweighting the feature importance values so that they sum to 1. The specification WEIGHTFEATURES=YES is ignored with a warning if no dependent variable is specified.