|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectorg.apache.spark.mllib.clustering.GaussianMixtureModel
public class GaussianMixtureModel
:: Experimental ::
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
Constructor Summary | |
---|---|
GaussianMixtureModel(double[] weights,
MultivariateGaussian[] gaussians)
|
Method Summary | |
---|---|
MultivariateGaussian[] |
gaussians()
|
int |
k()
Number of gaussians in mixture |
static GaussianMixtureModel |
load(SparkContext sc,
String path)
|
JavaRDD<Integer> |
predict(JavaRDD<Vector> points)
Java-friendly version of predict() |
RDD<Object> |
predict(RDD<Vector> points)
Maps given points to their cluster indices. |
RDD<double[]> |
predictSoft(RDD<Vector> points)
Given the input vectors, return the membership value of each vector to all mixture components. |
void |
save(SparkContext sc,
String path)
Save this model to the given path. |
double[] |
weights()
|
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GaussianMixtureModel(double[] weights, MultivariateGaussian[] gaussians)
Method Detail |
---|
public static GaussianMixtureModel load(SparkContext sc, String path)
public double[] weights()
public MultivariateGaussian[] gaussians()
public void save(SparkContext sc, String path)
Saveable
This saves: - human-readable (JSON) model metadata to path/metadata/ - Parquet formatted data to path/data/
The model may be loaded using Loader.load
.
save
in interface Saveable
sc
- Spark context used to save model data.path
- Path specifying the directory in which to save this model.
If the directory already exists, this method throws an exception.public int k()
public RDD<Object> predict(RDD<Vector> points)
public JavaRDD<Integer> predict(JavaRDD<Vector> points)
predict()
public RDD<double[]> predictSoft(RDD<Vector> points)
points
- (undocumented)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |