class GaussianMixture extends Serializable
This class performs expectation maximization for multivariate Gaussian Mixture Models (GMMs). A GMM represents a composite distribution of independent Gaussian distributions with associated "mixing" weights specifying each's contribution to the composite.
Given a set of sample points, this class will maximize the log-likelihood for a mixture of k Gaussians, iterating until the log-likelihood changes by less than convergenceTol, or until it has reached the max number of iterations. While this process is generally guaranteed to converge, it is not guaranteed to find a global optimum.
- Annotations
- @Since( "1.3.0" )
- Source
- GaussianMixture.scala
- Note
This algorithm is limited in its number of features since it requires storing a covariance matrix which has size quadratic in the number of features. Even when the number of features does not exceed this limit, this algorithm may perform poorly on high-dimensional data. This is due to high-dimensional data (a) making it difficult to cluster at all (based on statistical/theoretical arguments) and (b) numerical issues with Gaussian distributions.
- Alphabetic
- By Inheritance
- GaussianMixture
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
GaussianMixture()
Constructs a default instance.
Constructs a default instance. The default parameters are {k: 2, convergenceTol: 0.01, maxIterations: 100, seed: random}.
- Annotations
- @Since( "1.3.0" )
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getConvergenceTol: Double
Return the largest change in log-likelihood at which convergence is considered to have occurred.
Return the largest change in log-likelihood at which convergence is considered to have occurred.
- Annotations
- @Since( "1.3.0" )
-
def
getInitialModel: Option[GaussianMixtureModel]
Return the user supplied initial GMM, if supplied
Return the user supplied initial GMM, if supplied
- Annotations
- @Since( "1.3.0" )
-
def
getK: Int
Return the number of Gaussians in the mixture model
Return the number of Gaussians in the mixture model
- Annotations
- @Since( "1.3.0" )
-
def
getMaxIterations: Int
Return the maximum number of iterations allowed
Return the maximum number of iterations allowed
- Annotations
- @Since( "1.3.0" )
-
def
getSeed: Long
Return the random seed
Return the random seed
- Annotations
- @Since( "1.3.0" )
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
run(data: JavaRDD[Vector]): GaussianMixtureModel
Java-friendly version of
run()
Java-friendly version of
run()
- Annotations
- @Since( "1.3.0" )
-
def
run(data: RDD[Vector]): GaussianMixtureModel
Perform expectation maximization
Perform expectation maximization
- Annotations
- @Since( "1.3.0" )
-
def
setConvergenceTol(convergenceTol: Double): GaussianMixture.this.type
Set the largest change in log-likelihood at which convergence is considered to have occurred.
Set the largest change in log-likelihood at which convergence is considered to have occurred.
- Annotations
- @Since( "1.3.0" )
-
def
setInitialModel(model: GaussianMixtureModel): GaussianMixture.this.type
Set the initial GMM starting point, bypassing the random initialization.
Set the initial GMM starting point, bypassing the random initialization. You must call setK() prior to calling this method, and the condition (model.k == this.k) must be met; failure will result in an IllegalArgumentException
- Annotations
- @Since( "1.3.0" )
-
def
setK(k: Int): GaussianMixture.this.type
Set the number of Gaussians in the mixture model.
Set the number of Gaussians in the mixture model. Default: 2
- Annotations
- @Since( "1.3.0" )
-
def
setMaxIterations(maxIterations: Int): GaussianMixture.this.type
Set the maximum number of iterations allowed.
Set the maximum number of iterations allowed. Default: 100
- Annotations
- @Since( "1.3.0" )
-
def
setSeed(seed: Long): GaussianMixture.this.type
Set the random seed
Set the random seed
- Annotations
- @Since( "1.3.0" )
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()