Specifies the number of threads for the computation
You can specify the following options:
DATA=CAS-libref.data-table
names the input data table for PROC KCLUS to use. The default is the most recently created data table. CAS-libref.data-table is a two-level name, where
CAS-libref
refers to a collection of information that is defined in the LIBNAME statement and includes the caslib, which includes a path to the data, and a session identifier, which defaults to the active session but which can be explicitly defined in the LIBNAME statement. For more information about CAS-libref, see the section Using CAS Sessions and CAS Engine Librefs.
data-table
specifies the name of the input data table.
DISTANCE=EUCLIDEAN | MANHATTAN
specifies the distance measure for similarity that is used for interval input variables.
You can choose from the following measures:
EUCLIDEAN
calculates the Euclidean distance.
MANHATTAN
calculates the Manhattan distance.
By default, DISTANCE=EUCLIDEAN.
DISTANCENOM=BINARY | GLOBALFREQ | RELATIVEFREQ
specifies the distance measure for similarity that is used for nominal input variables.
You can choose from the following measures:
BINARY
calculates a simple matching distance.
GLOBALFREQ
calculates the distance based on the frequency of levels of nominal input variables in the input data table.
RELATIVEFREQ
calculates the distance based on the frequency of levels of nominal input variables in each cluster.
By default, DISTANCENOM=BINARY. For more information about these distance functions, see the section Clustering Nominal Variables.
INIT=FORGY | RAND
specifies the method for obtaining the initial estimate of cluster centers.
You can choose from the following methods:
FORGY
selects the initial cluster centers randomly from observations.
RAND
assigns all observations randomly to one of the clusters.
specifies the imputation method to be used when the INPUT statement specifies interval variables.
You can choose from the following methods:
MEAN
imputes missing values of variables in observations by using the mean value for that variable.
NONE
does not do any imputation and excludes observations that have missing values.
If IMPUTE=NONE and the number of observations that have nonmissing values is less than the value of the MAXCLUSTERS= option, then the number of clusters is set to the number of observations that have nonmissing values.
specifies the imputation method to be used when the INPUT statement specifies nominal variables.
You can choose from the following methods:
MODE
imputes missing values of variables in observations by using the mode value for that variable.
NONE
does not do any imputation and excludes observations that have any missing values.
If IMPUTENOM=NONE and the number of observations that have nonmissing values is less than the value of the MAXCLUSTERS= option, then the number of clusters is set to the number of observations that have nonmissing values.
specifies either the number of clusters to be used (if the NOC= option is not specified or NOC=NONE) or the maximum number of clusters to be searched (if NOC=ABC).
specifies the maximum number of iterations for the algorithm to perform. In each iteration of the k-means or k-modes clustering method, each observation is assigned to the nearest cluster centroid, and the centroids are recomputed.
specifies the method for estimating the number of clusters.
You can specify the following values:
ABC <suboptions>
estimates the number of clusters by using the aligned box criterion (ABC) method. For more information about this method, see the section Finding the Number of Clusters.
You can specify one or more of the following suboptions:
ALIGN=keyword
specifies the method for aligning the reference data based on the input data.
You can specify the following keywords:
NONE
generates the reference data from a uniform distribution over the range of values for each subset of the input data table.
PCA
generates the reference data from a uniform distribution over a box that is aligned with the principal components of each subset of the input data table.
By default, ALIGN=NONE.
B=number
specifies the number of reference data to be created for each cluster candidate. By default, B=1.
CRITERION=keyword
specifies the criterion to be used to estimate the number of clusters that use the statistics obtained by the ABC method.
You can specify the following keywords:
ALL
uses all the following options and selects the number of clusters based on which number of clusters is chosen the most often. If each option selects a different number of clusters, then the number selected by GLOBALPEAK is used.
FIRSTMAXWITHSTD
uses the smallest k such that the gap value for that k is greater than the one-standard-error adjusted gap value for k+1.
FIRSTPEAK
uses the first peak value among the peak values in gap statistics.
GLOBALPEAK
uses the maximum peak value among all the peak values in gap statistics.
By default, CRITERION=GLOBALPEAK.
MINCLUSTERS=number
specifies the minimum number of clusters for searching for the best number of clusters. By default, MINCLUSTERS=2.
NONE
does not estimate the number of clusters and uses the value specified in MAXCLUSTERS= option.
specifies the number of threads that are used in the computation. The default value is the number of CPUs available in the machine.
OUTSTAT <(OUTITER)>=data-table
creates the output data table that contains the cluster centroids for each cluster.
This data table includes the iteration number as _ITERATION_, the cluster ID as _CLUSTER_ID_ and the cluster centroids, which consist of the variables that are specified in the INPUT statement. If you specify STANDARDIZE=RANGE or STANDARDIZE=STD, the data table also contains the standardized values of the cluster centroids, which are displayed by adding the S_ prefix to the variables in the INPUT statement.
You can also specify the following suboption:
OUTITER
also outputs the cluster centroids to the OUTSTAT= data table for each iteration.
SEED=number
specifies an integer to be used to start the pseudorandom number generator. If you do not specify a seed or if you specify a value less than or equal to 0, the seed is generated from reading the time of day from the computer’s clock.
STANDARDIZE=NONE | RANGE | STD
specifies the method for standardizing the interval input variables. PROC KCLUS uses the location and scale measures specific to the method. You can specify the following values:
NONE
does not standardize and uses the actual values for the input variables.
RANGE
standardizes the input variables by using the range method. PROC KCLUS uses the minimum as the location and the range as the scale.
STD
standardizes the input variables by using the traditional standardization method. PROC KCLUS uses the mean as the location and the standard deviation as the scale.
specifies the method to use for convergence. If you do not specify this option, the algorithm stops after it reaches the maximum number of iterations (which is specified in MAXITER= option).
You can specify the following convergence_methods:
CLUSTER_CHANGE <(VALUE=number)>
uses the percentile of observations that do not change their cluster membership for that iteration. The optional VALUE= suboption enables you to specify the percentile of observations.
By default or if VALUE=0, PROC KCLUS runs until the cluster centroids no longer change.
WCSD_CHANGE <(VALUE=number)>
uses the within-cluster distance change as a convergence criterion. The optional VALUE= suboption enables you to specify the change in SSE for the k-means algorithm or specify the sum of within-cluster distances for the k-modes algorithm and the k-prototypes algorithm. For the k-prototypes algorithm, the distance is a mixed distance that includes both the interval and nominal parts.
KPROTOTYPEPARAMS=gamma_method
specifies the method for obtaining the parameter in the k-prototypes clustering algorithm (Huang 1997) for clustering mixed input data that contain both interval and nominal variables.
You can specify either of the following gamma_methods:
USERGAMMA(VALUE=number)
specifies the parameter value (in the VALUE= suboption) for the k-prototypes clustering algorithm. The value of should be an appropriate positive number that balances the difference between the scales of the nominal and interval input variables.
AUTOGAMMA
estimates the parameter value for the k-prototypes clustering algorithm. You can use this option when you do not have a clear idea of how large the value would be. When you specify the AUTOGAMMA option, the value of is inferred to be the average of the standard deviations of the interval input variables.
prints the distance that is contributed by the interval variables (as _DISTANCEINT_) and the distance that is contributed by the nominal variables (as _DISTANCENOM_) in the mixed distance that is used by the k-prototypes algorithm to the output table that is specified in the SCORE statement. For more information, see the section Score Output for Clustering Both Interval and Nominal Variables.