de.fu_berlin.ties.classify.winnow
Class UltraconservativeWinnow

java.lang.Object
  extended byde.fu_berlin.ties.classify.TrainableClassifier
      extended byde.fu_berlin.ties.classify.winnow.Winnow
          extended byde.fu_berlin.ties.classify.winnow.UltraconservativeWinnow
All Implemented Interfaces:
Classifier

public class UltraconservativeWinnow
extends Winnow

A combination of Winnow with the "ultraconservative" approach proposed by Koby Crammer and Yoram Singer. In case of a loss (mistake) the target class is promoted and all classes whose score is greater than or equal to the target class (the "error set") are demoted.

Instances of this class are thread-safe.

Version:
$Revision: 1.6 $, $Date: 2004/04/13 08:00:13 $, $Author: siefkes $
Author:
Christian Siefkes

Field Summary
 
Fields inherited from interface de.fu_berlin.ties.classify.Classifier
CONFIG_CLASSIFIER
 
Constructor Summary
UltraconservativeWinnow(Set allValidClasses)
          Creates a new instance by delegating to the corresponding super constructor.
UltraconservativeWinnow(Set allValidClasses, FeatureTransformer trans, boolean balance, float promotionFactor, float demotionFactor, float thresholdThick, int featureNum)
          Creates a new instance by delegating to the corresponding super constructor.
UltraconservativeWinnow(Set allValidClasses, FeatureTransformer trans, TiesConfiguration config)
          Creates a new instance by delegating to the corresponding super constructor.
UltraconservativeWinnow(Set allValidClasses, TiesConfiguration config)
          Creates a new instance by delegating to the corresponding super constructor.
 
Method Summary
protected  void chooseClassesToAdjust(WinnowDistribution winnowDist, String targetClass, Set classesToPromote, Set classesToDemote)
          Chooses the classes to promote and the classes to demote.
 
Methods inherited from class de.fu_berlin.ties.classify.winnow.Winnow
adjustWeights, confidence, defaultWeight, doClassify, doTrain, featureSet, getDemotion, getPromotion, getThresholdThickness, initScores, initWeight, initWeightArray, isBalanced, majorThreshold, minorThreshold, rawThreshold, sigmoid, threshold, toString, trainOnErrorHook, updateScores
 
Methods inherited from class de.fu_berlin.ties.classify.TrainableClassifier
classify, createClassifier, createClassifier, createClassifier, getAllClasses, train, trainOnError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UltraconservativeWinnow

public UltraconservativeWinnow(Set allValidClasses)
                        throws IllegalArgumentException
Creates a new instance by delegating to the corresponding super constructor.

Parameters:
allValidClasses - the set of all valid classes
Throws:
IllegalArgumentException - if one of the parameters is outside the allowed range

UltraconservativeWinnow

public UltraconservativeWinnow(Set allValidClasses,
                               TiesConfiguration config)
                        throws IllegalArgumentException
Creates a new instance by delegating to the corresponding super constructor.

Parameters:
allValidClasses - the set of all valid classes
config - contains configuration properties
Throws:
IllegalArgumentException - if one of the parameters is outside the allowed range

UltraconservativeWinnow

public UltraconservativeWinnow(Set allValidClasses,
                               FeatureTransformer trans,
                               TiesConfiguration config)
                        throws IllegalArgumentException
Creates a new instance by delegating to the corresponding super constructor.

Parameters:
allValidClasses - the set of all valid classes
trans - the last transformer in the transformer chain to use, or null if no feature transformers should be used
config - contains configuration properties
Throws:
IllegalArgumentException - if one of the parameters is outside the allowed range

UltraconservativeWinnow

public UltraconservativeWinnow(Set allValidClasses,
                               FeatureTransformer trans,
                               boolean balance,
                               float promotionFactor,
                               float demotionFactor,
                               float thresholdThick,
                               int featureNum)
                        throws IllegalArgumentException
Creates a new instance by delegating to the corresponding super constructor.

Parameters:
allValidClasses - the set of all valid classes
trans - the last transformer in the transformer chain to use, or null if no feature transformers should be used
balance - whether to use the Balanced Winnow or the standard Winnow algorithm
promotionFactor - the promotion factor used by the algorithm
demotionFactor - the demotion factor used by the algorithm
thresholdThick - the thickness of the threshold if the "thick threshold" heuristic is used (must be < 1.0), 0.0 otherwise
featureNum - the number of features to store
Throws:
IllegalArgumentException - if one of the parameters is outside the allowed range
Method Detail

chooseClassesToAdjust

protected void chooseClassesToAdjust(WinnowDistribution winnowDist,
                                     String targetClass,
                                     Set classesToPromote,
                                     Set classesToDemote)
Chooses the classes to promote and the classes to demote. This "ultraconservative" implementation demotes all classes whose score is greater than or equal to the target class (the "error set") and promotes the target class if the error set is not empty.

Overrides:
chooseClassesToAdjust in class Winnow
Parameters:
winnowDist - the prediction distribution returned by TrainableClassifier.classify(FeatureVector, Set)
targetClass - the expected class of this instance; must be contained in the set of candidateClasses
classesToPromote - the classes to promote are added to this set
classesToDemote - the classes to demote are added to this set


Copyright © 2003-2004 Christian Siefkes. All Rights Reserved.