edu.cmu.minorthird.classify
Class TweakedLearner

java.lang.Object
  extended by edu.cmu.minorthird.classify.BatchClassifierLearner
      extended by edu.cmu.minorthird.classify.BatchBinaryClassifierLearner
          extended by 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


Nested Class Summary
static class TweakedLearner.TweakedClassifier
          A Tweaked Classifier, with an optimization of the precision vs.
 
Field Summary
 
Fields inherited from class edu.cmu.minorthird.classify.BatchClassifierLearner
classifier, dataset
 
Constructor Summary
TweakedLearner(BinaryClassifierLearner innerLearner, double beta)
          Public methods
 
Method Summary
 Classifier batchTrain(Dataset dataset)
          subclasses should use this method to implement a batch supervised learning algorithm.
 double getBeta()
           
 BinaryClassifierLearner getInnerLearner()
           
static void main(java.lang.String[] args)
          Main method for testing purposes
 void setBeta(double beta)
           
 void setInnerLearner(BinaryClassifierLearner learner)
           
 
Methods inherited from class edu.cmu.minorthird.classify.BatchBinaryClassifierLearner
batchTrainBinary, getBinaryClassifier, getSchema, setSchema
 
Methods inherited from class edu.cmu.minorthird.classify.BatchClassifierLearner
addExample, completeTraining, copy, getClassifier, hasNextQuery, nextQuery, reset, setInstancePool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.cmu.minorthird.classify.ClassifierLearner
addExample, completeTraining, copy, getClassifier, hasNextQuery, nextQuery, reset, setInstancePool
 

Constructor Detail

TweakedLearner

public TweakedLearner(BinaryClassifierLearner innerLearner,
                      double beta)
Public methods

Method Detail

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