Class GridSearchParameterLearner<S extends Observation,T extends Category>
java.lang.Object
org.tweetyproject.machinelearning.ParameterTrainer<S,T>
org.tweetyproject.machinelearning.GridSearchParameterLearner<S,T>
- Type Parameters:
S
- the type of observations.T
- the type of categories.
- All Implemented Interfaces:
Trainer<S,
T>
public class GridSearchParameterLearner<S extends Observation,T extends Category>
extends ParameterTrainer<S,T>
A grid-search approach for learning parameters. For each parameter with I=[l,u] being
the boundaries for the parameter value of a given trainer, I is divided into
partitions
number of partitions. For each partition of each parameter the border points are chosen and a new
classifier is learned with given parameter combination. From all combinations the combination
where the classifier performs best is chosen. If depth
> 1, the process is iterated: after selecting
the best interval combination of the parameters, these intervals are again divided and the process
is repeated depth
many times.- Author:
- Matthias Thimm
-
Constructor Summary
ConstructorDescriptionGridSearchParameterLearner
(Trainer<S, T> trainer, ClassificationTester<S, T> tester, int depth, int partitions) Creates a new grid-search parameter learner with the given arguments. -
Method Summary
Modifier and TypeMethodDescriptionlearnParameters
(TrainingSet<S, T> trainingSet) Learns the best parameters of the given trainer for the training set.Methods inherited from class org.tweetyproject.machinelearning.ParameterTrainer
getParameterSet, setParameterSet, train, train
-
Constructor Details
-
GridSearchParameterLearner
public GridSearchParameterLearner(Trainer<S, T> trainer, ClassificationTester<S, T> tester, int depth, int partitions) Creates a new grid-search parameter learner with the given arguments.- Parameters:
trainer
- some trainer.tester
- some classification tester for measuring performance.depth
- the depth of the recursion.partitions
- the number of partitions.
-
-
Method Details
-
learnParameters
Description copied from class:ParameterTrainer
Learns the best parameters of the given trainer for the training set.- Specified by:
learnParameters
in classParameterTrainer<S extends Observation,
T extends Category> - Parameters:
trainingSet
- a training set- Returns:
- the best parameters for the training set.
-