diva.sketch.classification
Class GaussianWeightSet

java.lang.Object
  extended by diva.sketch.classification.WeightSet
      extended by diva.sketch.classification.GaussianWeightSet

public class GaussianWeightSet
extends WeightSet

Given a set of training examples (each example is a feature vector), a Gaussian classifier computes the mu and sigma for each type of features. The mu of a particular type of feature is calculated by taking the mean of the features of that type from the examples. The sigma is the standard deviation.

Version:
$Revision: 1.4 $
Author:
Heloise Hse (hwawen@eecs.berkeley.edu), Michael Shilman (michaels@eecs.berkeley.edu)

Constructor Summary
GaussianWeightSet(String type)
          Constructs a gaussian weight set with the specified type.
 
Method Summary
protected  FeatureSet computeMu()
          Calculates the mu value for Gaussian distribution by taking the mean of each feature type.
protected  FeatureSet computeSigma()
          Calculates the sigma of each feature in this classifier.
 
Methods inherited from class diva.sketch.classification.WeightSet
addExample, clearExamples, debug, examples, getExampleCount, getMuValues, getSigmaValues, getType, toString, train
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GaussianWeightSet

public GaussianWeightSet(String type)
Constructs a gaussian weight set with the specified type.

Method Detail

computeMu

protected FeatureSet computeMu()
                        throws ClassifierException
Calculates the mu value for Gaussian distribution by taking the mean of each feature type.

Specified by:
computeMu in class WeightSet
Throws:
ClassifierException

computeSigma

protected FeatureSet computeSigma()
                           throws ClassifierException
Calculates the sigma of each feature in this classifier. In Gaussian distribution, sigma equals standard deviation. This method assumes that the mu values have already been calculated, and will throw an exception if this is not the case.
   sigma[i] = (sqrt (sum (X[i]-u)^2)))/N
 

Specified by:
computeSigma in class WeightSet
Throws:
ClassifierException


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.