public class BalancedWinnowTrainer extends ClassifierTrainer implements Boostable, Serializable
The weight vectors are updated whenever the the classifier makes a mistake or just barely got the correct answer (highest dot product is within delta percent higher than the second highest). Suppose the classifier guessed j and answer was j'. For each feature i that is present, multiply w_ji by (1-epsilon) and multiply w_j'i by (1+epsilon)
The above procedure is done multiple times to the training examples (default is 5), and epsilon is cut by the cooling rate at each iteration (default is cutting epsilon by half).
| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_COOLING_RATE
0.5
|
static double |
DEFAULT_DELTA
0.1
|
static double |
DEFAULT_EPSILON
0.5
|
static int |
DEFAULT_MAX_ITERATIONS
30
|
| Constructor and Description |
|---|
BalancedWinnowTrainer()
Default constructor.
|
BalancedWinnowTrainer(double epsilon,
double delta,
int maxIterations,
double coolingRate) |
| Modifier and Type | Method and Description |
|---|---|
Classifier |
train(InstanceList trainingList,
InstanceList validationList,
InstanceList testSet,
ClassifierEvaluating evaluator,
Classifier initialClassifier)
Trains the classifier on the instance list, updating
class weight vectors as appropriate
|
public static final double DEFAULT_EPSILON
public static final double DEFAULT_DELTA
public static final int DEFAULT_MAX_ITERATIONS
public static final double DEFAULT_COOLING_RATE
public BalancedWinnowTrainer()
public BalancedWinnowTrainer(double epsilon,
double delta,
int maxIterations,
double coolingRate)
epsilon - percentage by which to increase/decrease weight vectors
when an example is misclassified.delta - percentage by which the highest (and correct) dot product
should exceed the second highest dot product before we consider an example
to be correctly classified (margin width) when adjusting weights.maxIterations - maximum number of times to loop through training examples.coolingRate - percentage of epsilon to decrease after each iterationpublic Classifier train(InstanceList trainingList, InstanceList validationList, InstanceList testSet, ClassifierEvaluating evaluator, Classifier initialClassifier)
train in class ClassifierTrainertrainingList - Instance list to be trained onvalidationList - 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.Copyright © 2019 JULIE Lab, Germany. All rights reserved.