edu.cmu.minorthird.classify
Class TweakedLearner
java.lang.Object
edu.cmu.minorthird.classify.BatchClassifierLearner
edu.cmu.minorthird.classify.BatchBinaryClassifierLearner
edu.cmu.minorthird.classify.TweakedLearner
- All Implemented Interfaces:
- BinaryClassifierLearner, ClassifierLearner, java.lang.Cloneable
- Direct Known Subclasses:
- Recommended.TweakedLearner
public class TweakedLearner
- extends BatchBinaryClassifierLearner
A Tweaked Learner, with an optimization of the precision vs. recall
- Author:
- Giora Unger
Created on May 19, 2005
A learner whose score was optimized according to an F_beta() function,
for a given beta. This optimization is used to fine-tune the precision
vs. recall for the underlying classification algorithm.
Values of beta<1.0 favor precision over recall, while values of
beta>1.0 favor recall over precision. beta=1.0 grants equal weight
to both precision and recall.
Reference: Jason D. M. Rennie,
Derivation of the F-Measure,
http://people.csail.mit.edu/jrennie/writing/fmeasure.pdf
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TweakedLearner
public TweakedLearner(BinaryClassifierLearner innerLearner,
double beta)
- Public methods
batchTrain
public Classifier batchTrain(Dataset dataset)
- Description copied from class:
BatchClassifierLearner
- subclasses should use this method to implement a batch supervised learning algorithm.
- Specified by:
batchTrain
in class BatchClassifierLearner
getBeta
public double getBeta()
- Returns:
- Returns the beta.
setBeta
public void setBeta(double beta)
- Parameters:
beta
- The beta to set.
getInnerLearner
public BinaryClassifierLearner getInnerLearner()
- Returns:
- Returns the innerLearner.
setInnerLearner
public void setInnerLearner(BinaryClassifierLearner learner)
- Parameters:
learner
- The innerLearner to set.
main
public static void main(java.lang.String[] args)
- Main method for testing purposes