# DiscreteKMeansMixtureModel

#### trait DiscreteKMeansMixtureModel[D <: DiscreteDistr[Int]] extends DiscreteMixtureModel[Int, D]

Linear Supertypes
DiscreteMixtureModel[Int, D], Logging, Serializable, Serializable, AnyRef, Any
Known Subclasses
Ordering
1. Alphabetic
2. By inheritance
Inherited
1. DiscreteKMeansMixtureModel
2. DiscreteMixtureModel
3. Logging
4. Serializable
5. Serializable
6. AnyRef
7. Any
1. Hide All
2. Show all
Visibility
1. Public
2. All

### Abstract Value Members

1. #### abstract def initializeDistribution(mean: Double, sigma: Double): D

Initializes the distributions, given a mean and a sigma.

Initializes the distributions, given a mean and a sigma.

mean

Mean for an initial distribution.

sigma

Standard deviation for an initial distribution.

returns

Returns a distribution.

Attributes
protected

### Concrete Value Members

1. #### final def !=(arg0: AnyRef): Boolean

Definition Classes
AnyRef
2. #### final def !=(arg0: Any): Boolean

Definition Classes
Any
3. #### final def ##(): Int

Definition Classes
AnyRef → Any
4. #### final def ==(arg0: AnyRef): Boolean

Definition Classes
AnyRef
5. #### final def ==(arg0: Any): Boolean

Definition Classes
Any
6. #### final def asInstanceOf[T0]: T0

Definition Classes
Any
7. #### def classMembership(value: Int, weighting: Array[Double], distributions: Array[D]): (Array[Double], Double)

Computes the assignment weights of a single point to the different distributions that we are fitting.

Computes the assignment weights of a single point to the different distributions that we are fitting.

value

The value of this point.

weighting

An array containing the weights of all current distributions.

distributions

An array containing all distributions we have fit.

returns

Returns a tuple containing the per-point weights of all distributions, and the expected complete log likelihood contribution of this point.

Attributes
protected
8. #### def clone(): AnyRef

Attributes
protected[java.lang]
Definition Classes
AnyRef
Annotations
@throws( ... )
9. #### def eStep(rdd: RDD[Int], distributions: Array[D], weighting: Array[Double])(implicit dTag: ClassTag[D]): (RDD[Array[Double]], Double)

Implements the basic expectation stage for most EM algorithms.

Implements the basic expectation stage for most EM algorithms. Algorithms that diverge from the traditional E step should override this method.

rdd

An RDD of data points.

distributions

An array containing the distributions fit in the last iteration. This array should contain k distributions, where k is the number of components in the mixture.

weighting

The weights of the different distributions.

returns

Returns an RDD of assignments to classes, and the total ECLL.

Attributes
protected
10. #### def em(rdd: RDD[Int], initialDistributions: Array[D], maxIterations: Int, initialWeights: Array[Double])(implicit dTag: ClassTag[D]): Array[D]

Runs an EM loop to fit a mixture model.

Runs an EM loop to fit a mixture model.

rdd

An RDD of doubles to fit the mixture model to.

initialDistributions

The initial distributions to start running EM from.

maxIterations

The maximum number of iterations to run.

returns

Returns an array of fit distributions.

Attributes
protected
11. #### final def eq(arg0: AnyRef): Boolean

Definition Classes
AnyRef
12. #### def equals(arg0: Any): Boolean

Definition Classes
AnyRef → Any
13. #### def finalize(): Unit

Attributes
protected[java.lang]
Definition Classes
AnyRef
Annotations
@throws( classOf[java.lang.Throwable] )
14. #### final def getClass(): Class[_]

Definition Classes
AnyRef → Any
15. #### def hashCode(): Int

Definition Classes
AnyRef → Any
16. #### final def isInstanceOf[T0]: Boolean

Definition Classes
Any
17. #### def isTraceEnabled(): Boolean

Attributes
protected
Definition Classes
Logging
18. #### def log: Logger

Attributes
protected
Definition Classes
Logging
19. #### def logDebug(msg: ⇒ String, throwable: Throwable): Unit

Attributes
protected
Definition Classes
Logging
20. #### def logDebug(msg: ⇒ String): Unit

Attributes
protected
Definition Classes
Logging
21. #### def logError(msg: ⇒ String, throwable: Throwable): Unit

Attributes
protected
Definition Classes
Logging
22. #### def logError(msg: ⇒ String): Unit

Attributes
protected
Definition Classes
Logging
23. #### def logInfo(msg: ⇒ String, throwable: Throwable): Unit

Attributes
protected
Definition Classes
Logging
24. #### def logInfo(msg: ⇒ String): Unit

Attributes
protected
Definition Classes
Logging
25. #### def logName: String

Attributes
protected
Definition Classes
Logging
26. #### def logTrace(msg: ⇒ String, throwable: Throwable): Unit

Attributes
protected
Definition Classes
Logging
27. #### def logTrace(msg: ⇒ String): Unit

Attributes
protected
Definition Classes
Logging
28. #### def logWarning(msg: ⇒ String, throwable: Throwable): Unit

Attributes
protected
Definition Classes
Logging
29. #### def logWarning(msg: ⇒ String): Unit

Attributes
protected
Definition Classes
Logging
30. #### final def ne(arg0: AnyRef): Boolean

Definition Classes
AnyRef
31. #### final def notify(): Unit

Definition Classes
AnyRef
32. #### final def notifyAll(): Unit

Definition Classes
AnyRef
33. #### final def synchronized[T0](arg0: ⇒ T0): T0

Definition Classes
AnyRef
34. #### def toString(): String

Definition Classes
AnyRef → Any
35. #### def train(rdd: RDD[Int], k: Int, maxIterations: Int)(implicit dTag: ClassTag[D]): Array[D]

Trains a mixture model on an integer dataset.

Trains a mixture model on an integer dataset.

rdd

Dataset to fit model to.

k

Number of mixture components.

returns

Returns an array of distributions.

Definition Classes
DiscreteKMeansMixtureModelDiscreteMixtureModel
36. #### final def wait(): Unit

Definition Classes
AnyRef
Annotations
@throws( ... )
37. #### final def wait(arg0: Long, arg1: Int): Unit

Definition Classes
AnyRef
Annotations
@throws( ... )
38. #### final def wait(arg0: Long): Unit

Definition Classes
AnyRef
Annotations
@throws( ... )