Class GaussianMixtureModel
Object
org.apache.spark.mllib.clustering.GaussianMixtureModel
- All Implemented Interfaces:
- Serializable,- Saveable
Multivariate Gaussian Mixture Model (GMM) consisting of k Gaussians, where points
 are drawn from each Gaussian i=1..k with probability w(i); mu(i) and sigma(i) are
 the respective mean and covariance for each Gaussian distribution i=1..k.
 
param: weights Weights for each Gaussian distribution in the mixture, where weights(i) is the weight for Gaussian i, and weights.sum == 1 param: gaussians Array of MultivariateGaussian where gaussians(i) represents the Multivariate Gaussian (Normal) Distribution for Gaussian i
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintk()Number of gaussians in mixturestatic GaussianMixtureModelload(SparkContext sc, String path) Java-friendly version ofpredict()intMaps given point to its cluster index.Maps given points to their cluster indices.double[]predictSoft(Vector point) Given the input vector, return the membership values to all mixture components.RDD<double[]>predictSoft(RDD<Vector> points) Given the input vectors, return the membership value of each vector to all mixture components.voidsave(SparkContext sc, String path) Save this model to the given path.double[]weights()
- 
Constructor Details- 
GaussianMixtureModel
 
- 
- 
Method Details- 
load
- 
weightspublic double[] weights()
- 
gaussians
- 
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.
- 
kpublic int k()Number of gaussians in mixture- Returns:
- (undocumented)
 
- 
predictMaps given points to their cluster indices.- Parameters:
- points- (undocumented)
- Returns:
- (undocumented)
 
- 
predictMaps given point to its cluster index.- Parameters:
- point- (undocumented)
- Returns:
- (undocumented)
 
- 
predictJava-friendly version ofpredict()- Parameters:
- points- (undocumented)
- Returns:
- (undocumented)
 
- 
predictSoftGiven the input vectors, return the membership value of each vector to all mixture components.- Parameters:
- points- (undocumented)
- Returns:
- (undocumented)
 
- 
predictSoftGiven the input vector, return the membership values to all mixture components.- Parameters:
- point- (undocumented)
- Returns:
- (undocumented)
 
 
-