de.fu_berlin.ties.classify.winnow
Class UltraconservativeWinnow

java.lang.Object
  extended by de.fu_berlin.ties.classify.TrainableClassifier
      extended by de.fu_berlin.ties.classify.winnow.Winnow
          extended by de.fu_berlin.ties.classify.winnow.UltraconservativeWinnow
All Implemented Interfaces:
Classifier, XMLStorable

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.12 $, $Date: 2004/09/06 17:22:20 $, $Author: siefkes $
Author:
Christian Siefkes

Field Summary
static String UC_SUFFIX
          Optional prefix used to give values for the configuration parameters of this classifier that differ from the values used by Winnow.
 
Fields inherited from class de.fu_berlin.ties.classify.TrainableClassifier
META_CLASSIFIER, MULTI_CLASSIFIER, OAR_CLASSIFIER
 
Fields inherited from interface de.fu_berlin.ties.classify.Classifier
CONFIG_CLASSIFIER
 
Constructor Summary
UltraconservativeWinnow(Set<String> allValidClasses)
          Creates a new instance by delegating to the corresponding super constructor.
UltraconservativeWinnow(Set<String> allValidClasses, FeatureTransformer trans, boolean balance, float promotionFactor, float demotionFactor, float thresholdThick, TiesConfiguration config, String configSuffix)
          Creates a new instance by delegating to the corresponding super constructor.
UltraconservativeWinnow(Set<String> allValidClasses, FeatureTransformer trans, TiesConfiguration config)
          Creates a new instance by delegating to the corresponding super constructor.
UltraconservativeWinnow(Set<String> allValidClasses, TiesConfiguration config)
          Creates a new instance by delegating to the corresponding super constructor.
 
Method Summary
protected  void chooseClassesToAdjust(WinnowDistribution winnowDist, String targetClass, Set<String> classesToPromote, Set<String> 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, reset, sigmoid, threshold, toString, trainOnErrorHook, updateScores
 
Methods inherited from class de.fu_berlin.ties.classify.TrainableClassifier
classify, createClassifier, createClassifier, createClassifier, createClassifier, getAllClasses, getConfig, shouldTrain, toElement, train, trainOnError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UC_SUFFIX

public static final String UC_SUFFIX
Optional prefix used to give values for the configuration parameters of this classifier that differ from the values used by Winnow.

See Also:
Constant Field Values
Constructor Detail

UltraconservativeWinnow

public UltraconservativeWinnow(Set<String> allValidClasses)
                        throws IllegalArgumentException,
                               ProcessingException
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
ProcessingException - if an error occurred while creating the feature transformer(s)

UltraconservativeWinnow

public UltraconservativeWinnow(Set<String> allValidClasses,
                               TiesConfiguration config)
                        throws IllegalArgumentException,
                               ProcessingException
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
ProcessingException - if an error occurred while creating the feature transformer(s)

UltraconservativeWinnow

public UltraconservativeWinnow(Set<String> allValidClasses,
                               FeatureTransformer trans,
                               TiesConfiguration config)
                        throws IllegalArgumentException,
                               ProcessingException
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
ProcessingException - if an error occurred while creating the feature transformer(s)

UltraconservativeWinnow

public UltraconservativeWinnow(Set<String> allValidClasses,
                               FeatureTransformer trans,
                               boolean balance,
                               float promotionFactor,
                               float demotionFactor,
                               float thresholdThick,
                               TiesConfiguration config,
                               String configSuffix)
                        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
config - contains configuration properties
configSuffix - optional suffix appended to the configuration keys when configuring this instance; might be null
Throws:
IllegalArgumentException - if one of the parameters is outside the allowed range
Method Detail

chooseClassesToAdjust

protected void chooseClassesToAdjust(WinnowDistribution winnowDist,
                                     String targetClass,
                                     Set<String> classesToPromote,
                                     Set<String> 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(de.fu_berlin.ties.classify.feature.FeatureVector, java.util.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.