|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.sketch.classification.WeightSet
public abstract class WeightSet
A WeightSet object represents a training type (e.g. square, class, circle, etc.) It has a mu vector and a sigma vector. Each element in the mu vector represents the average value (e.g. mean) for a particular feature of this class, and the corresponding sigma value indicates how much the value of the feature may vary (e.g. standard deviation). However, the exact statistical calculation for mu and sigma vary depending on the type of classification algorithms.
Constructor Summary | |
---|---|
WeightSet(String type)
Construct a WeightSet of the specified type. |
Method Summary | |
---|---|
void |
addExample(FeatureSet f)
Add an example to this classifier. |
void |
clearExamples()
Clear the examples. |
protected abstract FeatureSet |
computeMu()
Calculate the mu values for each feature in this class. |
protected abstract FeatureSet |
computeSigma()
Calculate the sigma values for each feature in this class. |
protected void |
debug(String s)
|
protected Iterator |
examples()
Return an iterator over the examples of this classifier. |
int |
getExampleCount()
Return the number of examples. |
FeatureSet |
getMuValues()
Return the mu values. |
FeatureSet |
getSigmaValues()
Return the sigma values. |
String |
getType()
Return the type of this classifier. |
String |
toString()
The text representation of this weight set. |
void |
train()
Train on the examples by computing the mu and sigma values for each feature. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WeightSet(String type)
Method Detail |
---|
public void addExample(FeatureSet f)
public void clearExamples()
protected abstract FeatureSet computeMu() throws ClassifierException
ClassifierException
protected abstract FeatureSet computeSigma() throws ClassifierException
ClassifierException
protected void debug(String s)
protected Iterator examples()
public int getExampleCount()
public FeatureSet getMuValues()
public FeatureSet getSigmaValues()
public String getType()
public void train() throws ClassifierException
ClassifierException
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |