Class BisectingKMeansModel
Object
org.apache.spark.mllib.clustering.BisectingKMeansModel
- All Implemented Interfaces:
- Serializable,- org.apache.spark.internal.Logging,- Saveable
public class BisectingKMeansModel
extends Object
implements Serializable, Saveable, org.apache.spark.internal.Logging
Clustering model produced by 
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
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classNested classes/interfaces inherited from interface org.apache.spark.internal.Loggingorg.apache.spark.internal.Logging.LogStringContext, org.apache.spark.internal.Logging.SparkShellLoggingFilter
- 
Constructor SummaryConstructorsConstructorDescriptionBisectingKMeansModel(org.apache.spark.mllib.clustering.ClusteringTreeNode root) 
- 
Method SummaryModifier and TypeMethodDescriptionVector[]Leaf cluster centers.doublecomputeCost(JavaRDD<Vector> data) Java-friendly version ofcomputeCost().doublecomputeCost(Vector point) Computes the squared distance between the input point and the cluster center it belongs to.doublecomputeCost(RDD<Vector> data) Computes the sum of squared distances between the input points and their corresponding cluster centers.intk()static BisectingKMeansModelload(SparkContext sc, String path) Java-friendly version ofpredict().intPredicts the index of the cluster that the input point belongs to.Predicts the indices of the clusters that the input points belong to.voidsave(SparkContext sc, String path) Save this model to the given path.doubleMethods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.spark.internal.LogginginitializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, isTraceEnabled, log, logBasedOnLevel, logDebug, logDebug, logDebug, logDebug, logError, logError, logError, logError, logInfo, logInfo, logInfo, logInfo, logName, LogStringContext, logTrace, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, logWarning, MDC, org$apache$spark$internal$Logging$$log_, org$apache$spark$internal$Logging$$log__$eq, withLogContext
- 
Constructor Details- 
BisectingKMeansModelpublic BisectingKMeansModel(org.apache.spark.mllib.clustering.ClusteringTreeNode root) 
 
- 
- 
Method Details- 
load
- 
distanceMeasure
- 
trainingCostpublic double trainingCost()
- 
clusterCentersLeaf cluster centers.- Returns:
- (undocumented)
 
- 
kpublic int k()
- 
predictPredicts the index of the cluster that the input point belongs to.- Parameters:
- point- (undocumented)
- Returns:
- (undocumented)
 
- 
predictPredicts the indices of the clusters that the input points belong to.- Parameters:
- points- (undocumented)
- Returns:
- (undocumented)
 
- 
predictJava-friendly version ofpredict().- Parameters:
- points- (undocumented)
- Returns:
- (undocumented)
 
- 
computeCostComputes the squared distance between the input point and the cluster center it belongs to.- Parameters:
- point- (undocumented)
- Returns:
- (undocumented)
 
- 
computeCostComputes the sum of squared distances between the input points and their corresponding cluster centers.- Parameters:
- data- (undocumented)
- Returns:
- (undocumented)
 
- 
computeCostJava-friendly version ofcomputeCost().- Parameters:
- data- (undocumented)
- Returns:
- (undocumented)
 
- 
saveDescription copied from interface:SaveableSave this model to the given path.This saves: - human-readable (JSON) model metadata to path/metadata/ - Parquet formatted data to path/data/ The model may be loaded using Loader.load.
 
-