public class BisectingKMeansModel extends java.lang.Object implements scala.Serializable, Logging
BisectingKMeans.
The prediction is done level-by-level from the root node to a leaf node, and at each node among
its children the closest to the input point is selected.
param: root the root node of the clustering tree
| Modifier and Type | Method and Description |
|---|---|
Vector[] |
clusterCenters()
Leaf cluster centers.
|
double |
computeCost(JavaRDD<Vector> data)
Java-friendly version of
computeCost(). |
double |
computeCost(RDD<Vector> data)
Computes the sum of squared distances between the input points and their corresponding cluster
centers.
|
double |
computeCost(Vector point)
Computes the squared distance between the input point and the cluster center it belongs to.
|
int |
k()
Number of leaf clusters.
|
JavaRDD<java.lang.Integer> |
predict(JavaRDD<Vector> points)
Java-friendly version of
predict(). |
RDD<java.lang.Object> |
predict(RDD<Vector> points)
Predicts the indices of the clusters that the input points belong to.
|
int |
predict(Vector point)
Predicts the index of the cluster that the input point belongs to.
|
org.apache.spark.mllib.clustering.ClusteringTreeNode |
root() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarningpublic org.apache.spark.mllib.clustering.ClusteringTreeNode root()
public Vector[] clusterCenters()
public int k()
public int predict(Vector point)
point - (undocumented)public RDD<java.lang.Object> predict(RDD<Vector> points)
points - (undocumented)public JavaRDD<java.lang.Integer> predict(JavaRDD<Vector> points)
predict().points - (undocumented)public double computeCost(Vector point)
point - (undocumented)public double computeCost(RDD<Vector> data)
data - (undocumented)