KMeansSummary#
- class pyspark.ml.clustering.KMeansSummary(java_obj=None)[source]#
Summary of KMeans.
Added in version 2.1.0.
Attributes
DataFrame of predicted cluster centers for each training data point.
Size of (number of data points in) each cluster.
Name for column of features in predictions.
The number of clusters the model was trained with.
Number of iterations.
Name for column of predicted clusters in predictions.
DataFrame produced by the model's transform method.
K-means cost (sum of squared distances to the nearest centroid for all points in the training dataset).
Attributes Documentation
- cluster#
DataFrame of predicted cluster centers for each training data point.
Added in version 2.1.0.
- clusterSizes#
Size of (number of data points in) each cluster.
Added in version 2.1.0.
- featuresCol#
Name for column of features in predictions.
Added in version 2.1.0.
- k#
The number of clusters the model was trained with.
Added in version 2.1.0.
- numIter#
Number of iterations.
Added in version 2.4.0.
- predictionCol#
Name for column of predicted clusters in predictions.
Added in version 2.1.0.
- predictions#
DataFrame produced by the model’s transform method.
Added in version 2.1.0.
- trainingCost#
K-means cost (sum of squared distances to the nearest centroid for all points in the training dataset). This is equivalent to sklearn’s inertia.
Added in version 2.4.0.