marytts.machinelearning
Class GmmDiscretizer

java.lang.Object
  extended by marytts.machinelearning.GmmDiscretizer
All Implemented Interfaces:
Discretizer

public class GmmDiscretizer
extends java.lang.Object
implements Discretizer

This discretizes values according to a gaussian mixture model (gmm). The result of discretization is the mean of the class that contributed most probability to a point.

Author:
benjaminroth

Constructor Summary
GmmDiscretizer(GMM model, boolean extraZeroClass)
          This constructs a Discretizer using the specified mixture model.
 
Method Summary
 int discretize(int value)
          This discretizes a value by returning the mean of that gaussian component that has maximum probability for it.
 int[] getPossibleValues()
          Returns all poosible discretizations values can be mapped to.
static GmmDiscretizer trainDiscretizer(java.util.List<java.lang.Integer> values, int nrClasses, boolean extraZero)
          This trains a gaussian mixture model having the specified number of components.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GmmDiscretizer

public GmmDiscretizer(GMM model,
                      boolean extraZeroClass)
This constructs a Discretizer using the specified mixture model.

Parameters:
model - GMM to be used
extraZeroClass - specifies if zeros should be treated independently
Method Detail

trainDiscretizer

public static GmmDiscretizer trainDiscretizer(java.util.List<java.lang.Integer> values,
                                              int nrClasses,
                                              boolean extraZero)
This trains a gaussian mixture model having the specified number of components.

Parameters:
values - the data the model is trained with
nrClasses - number of components the mixture will have
extraZero - specifies if zeroes are to be treated seperately from mixture model training and application.
Returns:
a discretizer that discretizes according to the trained model

discretize

public int discretize(int value)
This discretizes a value by returning the mean of that gaussian component that has maximum probability for it.

Specified by:
discretize in interface Discretizer
Parameters:
value - the value to be discretized
Returns:
the discretization the value is mapped to

getPossibleValues

public int[] getPossibleValues()
Returns all poosible discretizations values can be mapped to.

Specified by:
getPossibleValues in interface Discretizer
Returns:
all poosible discretizations values can be mapped to.