Package org.apache.spark.ml.clustering
Class KMeansAggregator
Object
org.apache.spark.ml.clustering.KMeansAggregator
- All Implemented Interfaces:
Serializable
KMeansAggregator computes the distances and updates the centers for blocks
in sparse or dense matrix in an online fashion.
param: centerMatrix The matrix containing center vectors.
param: k The number of clusters.
param: numFeatures The number of features.
param: distanceMeasure The distance measure.
When 'euclidean' is chosen, the instance blocks should contains
the squared norms in the labels field;
When 'cosine' is chosen, the vectors should be already normalized.
- See Also:
-
Constructor Summary
ConstructorDescriptionKMeansAggregator
(DenseMatrix centerMatrix, int k, int numFeatures, String distanceMeasure) -
Method Summary
-
Constructor Details
-
KMeansAggregator
-
-
Method Details
-
add
-
centerMatrix
-
costSum
public double costSum() -
count
public long count() -
distanceMeasure
-
k
public int k() -
numFeatures
public int numFeatures() -
sumMat
-
weightSum
public double weightSum() -
weightSumVec
-