|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umass.cs.mallet.base.classify.ClassifierTrainer
edu.umass.cs.mallet.base.classify.WinnowTrainer
An implementation of the training methods of a
Winnow2 on-line classifier. Given an instance xi,
the algorithm computes Sum(xi*wi), where wi is
the weight for that feature in the given class.
If the Sum is greater than some threshold
theta
, then the classifier guess
true for that class.
Only when the classifier makes a mistake are the
weights updated in one of two steps:
Promote: guessed 0 and answer was 1. Multiply
all weights of present features by alpha
.
Demote: guessed 1 and answer was 0. Divide
all weights of present features by beta
.
Limitations: Winnow2 only considers binary feature
vectors (i.e. whether or not the feature is present,
not its value).
Constructor Summary | |
WinnowTrainer()
Default constructor. |
|
WinnowTrainer(double a,
double b)
Sets alpha and beta and default value for theta |
|
WinnowTrainer(double a,
double b,
double nfact)
Sets alpha, beta, and nfactor |
Method Summary | |
Classifier |
train(InstanceList trainingList,
InstanceList validationList,
InstanceList testSet,
ClassifierEvaluating evaluator,
Classifier initialClassifier)
Trains winnow on the instance list, updating weights according to errors |
Methods inherited from class edu.umass.cs.mallet.base.classify.ClassifierTrainer |
main, toString, train, train, train, train |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public WinnowTrainer()
public WinnowTrainer(double a, double b)
a
- alpha valueb
- beta valuepublic WinnowTrainer(double a, double b, double nfact)
a
- alpha valueb
- beta valuenfact
- nfactor valueMethod Detail |
public Classifier train(InstanceList trainingList, InstanceList validationList, InstanceList testSet, ClassifierEvaluating evaluator, Classifier initialClassifier)
weights
according to errors
train
in class ClassifierTrainer
trainingList
- examples used to set parameters.validationList
- examples used to tune meta-parameters. May be null.testSet
- examples not examined at all for training, but passed on to diagnostic routines. May be null.initialClassifier
- training process may start from here. The parameters of the initialClassifier are not modified. May be null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |