S
- The type of observations.T
- The type of categories.public abstract class ParameterTrainer<S extends Observation,T extends Category> extends java.lang.Object implements Trainer<S,T>
Modifier and Type | Field and Description |
---|---|
private Trainer<S,T> |
trainer
The trainer for which we seek the best parameters.
|
Constructor and Description |
---|
ParameterTrainer(Trainer<S,T> trainer)
Creates a new parameter trainer for the given trainer.
|
Modifier and Type | Method and Description |
---|---|
ParameterSet |
getParameterSet()
Returns the set of parameters for this trainer.
|
protected Trainer<S,T> |
getTrainer()
Returns the trainer of this parameter trainer.
|
abstract ParameterSet |
learnParameters(TrainingSet<S,T> trainingSet)
Learns the best parameters of the given trainer for the training set.
|
boolean |
setParameterSet(ParameterSet params)
Sets the parameters for this trainer (calling this
method must ensure that the next time
train(TrainingSet
is used it uses these parameters. |
Classifier |
train(TrainingSet<S,T> trainingSet)
Trains a classifier on the given training set.
|
Classifier |
train(TrainingSet<S,T> trainingSet,
ParameterSet params)
Trains a classifier on the given training set with the given parameters
|
private Trainer<S extends Observation,T extends Category> trainer
public abstract ParameterSet learnParameters(TrainingSet<S,T> trainingSet)
trainingSet
- a training setpublic Classifier train(TrainingSet<S,T> trainingSet)
Trainer
public Classifier train(TrainingSet<S,T> trainingSet, ParameterSet params)
Trainer
public ParameterSet getParameterSet()
Trainer
getParameterSet
in interface Trainer<S extends Observation,T extends Category>
public boolean setParameterSet(ParameterSet params)
Trainer
train(TrainingSet trainingSet)
is used it uses these parameters.setParameterSet
in interface Trainer<S extends Observation,T extends Category>
params
- a parameter set.