|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.aisb.bio.tools.Classifier org.aisb.bio.tools.EuclideanMeanClassifier
This classifier just figures out the mean of all the features in the training data, and then classifies data by calculating the Euclidean distance between the data to be classified and the means for the categories. Pretty simple stuff.
In this particular case, the "data" must be a vector (array) of doubles. Each elemenet of data must be of the same length, but we don't need to care what that length is.
Constructor Summary | |
EuclideanMeanClassifier()
|
Method Summary | |
java.lang.String |
classify(java.lang.Object testData)
Given a trained classifier, use it to classify a piece of data. |
void |
finishTraining()
|
void |
startTraining()
|
void |
train(java.lang.String label,
java.lang.Object trainingDatum)
Feed training data to the classifier. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EuclideanMeanClassifier()
Method Detail |
public void startTraining()
startTraining
in class Classifier
public void finishTraining()
finishTraining
in class Classifier
public void train(java.lang.String label, java.lang.Object trainingDatum)
Classifier
train
in class Classifier
label
- The label that this unit of data has.trainingDatum
- The data to be used for classification.public java.lang.String classify(java.lang.Object testData)
Classifier
classify
in class Classifier
testData
- The data to be classified.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |