DaalKMeansModel train¶
-
train
(self, frame, observation_columns, column_scalings=None, k=2, max_iterations=100, label_column='predicted_cluster')¶ [ALPHA] Creates DAAL KMeans Model from train frame.
Parameters: frame : Frame
A frame to train the model on.
observation_columns : list
Columns containing the observations.
column_scalings : list (default=None)
Optional column scalings for each of the observation columns. The scaling value is multiplied by the corresponding value in the observation column.
k : int32 (default=2)
Desired number of clusters. Default is 2.
max_iterations : int32 (default=100)
Number of iterations for which the algorithm should run. Default is 20.
label_column : unicode (default=predicted_cluster)
Optional name of output column with index of cluster each observation belongs to.
Returns: : dict
- dictionary
A dictionary with trained KMeans model with the following keys:
‘centroids’ : dictionary with ‘Cluster:id’ as the key and the corresponding centroid as the value ‘assignments’ : Frame with cluster assignments.
Creating a DAAL KMeans Model using the observation columns. The algorithm chooses random observations as the initial cluster centers.
Examples
See here for examples.