A - the type of the classifier.public class EvaluationListener<A extends Classifier> extends Object implements IterationCompletionListener
Minimizer
of choice and will be triggered at a configurable interval of iterations
(through setRunInterval(int)). This class is designed to be
subclasses and enhanced with other print statements or functionality to save
the best performing parameters.| Modifier and Type | Field and Description |
|---|---|
protected WeightMapper<A> |
mapper |
protected int |
runInterval |
protected EvaluationSplit |
split |
| Constructor and Description |
|---|
EvaluationListener(WeightMapper<A> mapper,
EvaluationSplit split)
Initializes this listener.
|
EvaluationListener(WeightMapper<A> mapper,
EvaluationSplit split,
int runInterval)
Initializes this listener.
|
| Modifier and Type | Method and Description |
|---|---|
void |
onIterationFinished(int iteration,
double cost,
de.jungblut.math.DoubleVector currentWeights)
This callback is called from a
AbstractMinimizer when a iteration
of a minimization objective is finished. |
protected void |
onResult(int iteration,
double cost,
Evaluator.EvaluationResult trainEval,
Evaluator.EvaluationResult testEval)
Will be called on a result of the evaluation.
|
void |
setRunInterval(int runInterval)
Sets the run intervall of this listener.
|
protected final EvaluationSplit split
protected final WeightMapper<A extends Classifier> mapper
protected int runInterval
public EvaluationListener(WeightMapper<A> mapper, EvaluationSplit split)
mapper - the mapper that converts the DoubleVector from the
minimizable CostFunction to a classifier.split - the train/test split.public EvaluationListener(WeightMapper<A> mapper, EvaluationSplit split, int runInterval)
mapper - the mapper that converts the DoubleVector from the
minimizable CostFunction to a classifier.split - the train/test split.runInterval - test interval.public void onIterationFinished(int iteration,
double cost,
de.jungblut.math.DoubleVector currentWeights)
IterationCompletionListenerAbstractMinimizer when a iteration
of a minimization objective is finished.onIterationFinished in interface IterationCompletionListeneriteration - the number of the current iteration.cost - the cost at the current iteration.currentWeights - the current optimal weights.public final void setRunInterval(int runInterval)
protected void onResult(int iteration,
double cost,
Evaluator.EvaluationResult trainEval,
Evaluator.EvaluationResult testEval)
iteration - the current number of iteration.cost - the identified cost of the costfunction.trainEval - the evaluation on the trainingset.testEval - the evaluation on the testset.Copyright © 2016. All rights reserved.