Class ParameterTrainer<S extends Observation,T extends Category>
java.lang.Object
org.tweetyproject.machinelearning.ParameterTrainer<S,T>
- Type Parameters:
S
- The type of observations.T
- The type of categories.
- All Implemented Interfaces:
Trainer<S,
T>
- Direct Known Subclasses:
GridSearchParameterLearner
public abstract class ParameterTrainer<S extends Observation,T extends Category>
extends Object
implements Trainer<S,T>
Performs a parameter training on a given trainer, i.e. explores the space
of the parameters to obtain the best parameters for training.
- Author:
- Matthias Thimm
-
Constructor Summary
ConstructorDescriptionParameterTrainer
(Trainer<S, T> trainer) Creates a new parameter trainer for the given trainer. -
Method Summary
Modifier and TypeMethodDescriptionReturns the set of parameters for this 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 timetrain(TrainingSet<S,T> trainingSet)
is used it uses these parameters.train
(TrainingSet<S, T> trainingSet) Trains a classifier on the given training set.train
(TrainingSet<S, T> trainingSet, ParameterSet params) Trains a classifier on the given training set with the given parameters
-
Constructor Details
-
ParameterTrainer
Creates a new parameter trainer for the given trainer.- Parameters:
trainer
- some trainer.
-
-
Method Details
-
learnParameters
Learns the best parameters of the given trainer for the training set.- Parameters:
trainingSet
- a training set- Returns:
- the best parameters for the training set.
-
train
Description copied from interface:Trainer
Trains a classifier on the given training set. -
train
Description copied from interface:Trainer
Trains a classifier on the given training set with the given parameters -
getParameterSet
Description copied from interface:Trainer
Returns the set of parameters for this trainer.- Specified by:
getParameterSet
in interfaceTrainer<S extends Observation,
T extends Category> - Returns:
- the set of parameters for this trainer.
-
setParameterSet
Description copied from interface:Trainer
Sets the parameters for this trainer (calling this method must ensure that the next timetrain(TrainingSet<S,T> trainingSet)
is used it uses these parameters.- Specified by:
setParameterSet
in interfaceTrainer<S extends Observation,
T extends Category> - Parameters:
params
- a parameter set.- Returns:
- true if the operation was successful.
-