Interface Classifier<U>
- All Known Implementing Classes:
LogisticRegressionClassifier
,NaiveBayesClassifier
public interface Classifier<U>
Methods for defining a supervised machine learning classifier.
-
Method Summary
Modifier and Type Method Description int
classify(Instance<U> instance)
Obtains the most likely class for a certain instance.double
computeScore(Instance<U> instance, int category)
Gets the score for an individual pattern in a certain category.java.util.Map<java.lang.Integer,java.lang.Double>
computeScores(Instance<U> instance)
Computes the scores for an individual instance (once the training has been done).void
train(InstanceSet<U> trainSet)
Trains the classifier.
-
Method Details
-
train
Trains the classifier.- Parameters:
trainSet
- the training set.
-
computeScores
Computes the scores for an individual instance (once the training has been done).- Parameters:
instance
- the individual instance.- Returns:
- A score for each class.
-
computeScore
Gets the score for an individual pattern in a certain category.- Parameters:
category
- the class.instance
- the pattern.- Returns:
- the score.
-
classify
Obtains the most likely class for a certain instance.- Parameters:
instance
- the individual instance.- Returns:
- The most likely class.
-