DaalKMeansModel predict


predict(self, frame, observation_columns=None, label_column=None)

[BETA] Predict the cluster assignments for the data points.

Parameters:

frame : Frame

A frame whose labels are to be predicted. By default, predict is run on the same columns over which the model is trained.

observation_columns : list (default=None)

Column(s) containing the observations whose clusters are to be predicted. Default is to predict the clusters over columns the KMeans model was trained on.

label_column : unicode (default=None)

Name of output column with index of cluster each observation belongs to.

Returns:

: Frame

Frame

A new frame consisting of the existing columns of the frame and the following new columns: ‘k’ columns : Each of the ‘k’ columns containing squared distance of that observation to the ‘k’th cluster center predicted_cluster column: The cluster assignment for the observation

Predicts the clusters for each data point and distance to every cluster center of the frame using the trained model

Examples

See here for examples.