gov.sandia.cognition.learning.function.categorization
Class DefaultConfidenceWeightedBinaryCategorizer

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.function.categorization.AbstractBinaryCategorizer<InputType>
          extended by gov.sandia.cognition.learning.function.categorization.AbstractDiscriminantBinaryCategorizer<Vectorizable>
              extended by gov.sandia.cognition.learning.function.categorization.LinearBinaryCategorizer
                  extended by gov.sandia.cognition.learning.function.categorization.AbstractConfidenceWeightedBinaryCategorizer
                      extended by gov.sandia.cognition.learning.function.categorization.DefaultConfidenceWeightedBinaryCategorizer
All Implemented Interfaces:
Evaluator<Vectorizable,Boolean>, BinaryCategorizer<Vectorizable>, Categorizer<Vectorizable,Boolean>, ConfidenceWeightedBinaryCategorizer, DiscriminantBinaryCategorizer<Vectorizable>, DiscriminantCategorizer<Vectorizable,Boolean,Double>, ThresholdBinaryCategorizer<Vectorizable>, VectorInputEvaluator<Vectorizable,Boolean>, CloneableSerializable, Serializable, Cloneable

public class DefaultConfidenceWeightedBinaryCategorizer
extends AbstractConfidenceWeightedBinaryCategorizer

A default implementation of the ConfidenceWeightedBinaryCategorizer that stores a full mean and covariance matrix.

Since:
3.3.0
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
protected  Matrix covariance
          The covariance matrix.
 
Fields inherited from class gov.sandia.cognition.learning.function.categorization.LinearBinaryCategorizer
DEFAULT_BIAS
 
Fields inherited from class gov.sandia.cognition.learning.function.categorization.AbstractBinaryCategorizer
BINARY_CATEGORIES
 
Constructor Summary
DefaultConfidenceWeightedBinaryCategorizer()
          Creates a new, uninitialized DefaultConfidenceWeightedBinaryCategorizer.
DefaultConfidenceWeightedBinaryCategorizer(Vector mean, Matrix covariance)
          Creates a new DefaultConfidenceWeightedBinaryCategorizer with the given mean and covariance.
 
Method Summary
 UnivariateGaussian evaluateAsGaussian(Vectorizable input)
          Returns the univariate Gaussian distribution over the output of the distribution of weight vectors times the input, with the confidence that the categorizer was trained using.
 Matrix getCovariance()
          Gets the covariance matrix of the categorizer.
 void setCovariance(Matrix covariance)
          Sets the covariance matrix.
 
Methods inherited from class gov.sandia.cognition.learning.function.categorization.AbstractConfidenceWeightedBinaryCategorizer
createWeightDistribution, evaluateAsBernoulli, getMean, isInitialized, setMean
 
Methods inherited from class gov.sandia.cognition.learning.function.categorization.LinearBinaryCategorizer
clone, evaluateAsDouble, evaluateAsDouble, getBias, getInputDimensionality, getThreshold, getWeights, setBias, setThreshold, setWeights, toString
 
Methods inherited from class gov.sandia.cognition.learning.function.categorization.AbstractDiscriminantBinaryCategorizer
evaluate, evaluateWithDiscriminant
 
Methods inherited from class gov.sandia.cognition.learning.function.categorization.AbstractBinaryCategorizer
getCategories
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.math.matrix.VectorInputEvaluator
getInputDimensionality
 
Methods inherited from interface gov.sandia.cognition.learning.function.categorization.ThresholdBinaryCategorizer
getThreshold, setThreshold
 
Methods inherited from interface gov.sandia.cognition.learning.function.categorization.DiscriminantBinaryCategorizer
evaluateAsDouble
 
Methods inherited from interface gov.sandia.cognition.learning.function.categorization.DiscriminantCategorizer
evaluateWithDiscriminant
 
Methods inherited from interface gov.sandia.cognition.learning.function.categorization.Categorizer
getCategories
 
Methods inherited from interface gov.sandia.cognition.evaluator.Evaluator
evaluate
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Field Detail

covariance

protected Matrix covariance
The covariance matrix.

Constructor Detail

DefaultConfidenceWeightedBinaryCategorizer

public DefaultConfidenceWeightedBinaryCategorizer()
Creates a new, uninitialized DefaultConfidenceWeightedBinaryCategorizer.


DefaultConfidenceWeightedBinaryCategorizer

public DefaultConfidenceWeightedBinaryCategorizer(Vector mean,
                                                  Matrix covariance)
Creates a new DefaultConfidenceWeightedBinaryCategorizer with the given mean and covariance. The covariance matrix must be an d by d matrix where d is the dimensionality of the mean.

Parameters:
mean - The mean vector.
covariance - The covariance matrix.
Method Detail

evaluateAsGaussian

public UnivariateGaussian evaluateAsGaussian(Vectorizable input)
Description copied from interface: ConfidenceWeightedBinaryCategorizer
Returns the univariate Gaussian distribution over the output of the distribution of weight vectors times the input, with the confidence that the categorizer was trained using.

Parameters:
input - The input to evaluate.
Returns:
The distribution of outputs as a Gaussian.

getCovariance

public Matrix getCovariance()
Description copied from interface: ConfidenceWeightedBinaryCategorizer
Gets the covariance matrix of the categorizer.

Returns:
The covariance matrix.

setCovariance

public void setCovariance(Matrix covariance)
Sets the covariance matrix. Must be a square matrix the same size as the dimensionality of the mean.

Parameters:
covariance - The covariance matrix.