org.aisb.bio.tools
Class Classifier

java.lang.Object
  extended byorg.aisb.bio.tools.Classifier
Direct Known Subclasses:
EuclideanMeanClassifier

public abstract class Classifier
extends java.lang.Object

This is the abstract class to be subclassed by arbitrary data classifiers. Individual classifiers may need more methods than these to be configured, but once one is up and running we should be able to use it via this interface.

This is for supervised learning algorithms, as the data is tagged with a label when it's added.

To use objects that implement this: create an object, call the "startTraining()" method, call "train(label, data)" with each labeled piece of data, and then call the "finishTraining()" method. Once you've done that, call "classify(data)" and you'll get back whichever of the labels you used is the best fit for the new data.

Author:
Doug DeJulio

Constructor Summary
Classifier()
           
 
Method Summary
abstract  java.lang.String classify(java.lang.Object data)
          Given a trained classifier, use it to classify a piece of data.
 void finishTraining()
           
 void startTraining()
           
abstract  void train(java.lang.String label, java.lang.Object data)
          Feed training data to the classifier.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Classifier

public Classifier()
Method Detail

startTraining

public void startTraining()

finishTraining

public void finishTraining()

train

public abstract void train(java.lang.String label,
                           java.lang.Object data)
Feed training data to the classifier.

Parameters:
label - The label that this unit of data has.
data - The data to be used for classification.

classify

public abstract java.lang.String classify(java.lang.Object data)
Given a trained classifier, use it to classify a piece of data.

Parameters:
data - The data to be classified.
Returns:
The label the classifier assigns to this data.