Class MultiClassRbfTrainer
java.lang.Object
org.tweetyproject.machinelearning.svm.MultiClassRbfTrainer
- All Implemented Interfaces:
Trainer<DefaultObservation,DoubleCategory>
public class MultiClassRbfTrainer
extends Object
implements Trainer<DefaultObservation,DoubleCategory>
Trains a standard multi-class RBF support vector machine.
- Author:
- Matthias Thimm
-
Field Summary
Modifier and TypeFieldDescriptionstatic TrainingParameter
The c parameter for learningstatic TrainingParameter
The gamma parameter for learning -
Constructor Summary
ConstructorDescriptionInitializes the trainer with the default parameters.MultiClassRbfTrainer(double c, double gamma)
Initializes the trainer with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionReturns the set of parameters for this trainer.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.toString()
train(TrainingSet<DefaultObservation,DoubleCategory> trainingSet)
Trains a classifier on the given training set.train(TrainingSet<DefaultObservation,DoubleCategory> trainingSet, ParameterSet params)
Trains a classifier on the given training set with the given parameters
-
Field Details
-
C_PARAMETER
The c parameter for learning -
GAMMA_PARAMETER
The gamma parameter for learning
-
-
Constructor Details
-
MultiClassRbfTrainer
public MultiClassRbfTrainer()Initializes the trainer with the default parameters. -
MultiClassRbfTrainer
public MultiClassRbfTrainer(double c, double gamma)Initializes the trainer with the given parameters.- Parameters:
c
- the c parameter for learninggamma
- the gamma parameter for learning
-
-
Method Details
-
train
Description copied from interface:Trainer
Trains a classifier on the given training set.- Specified by:
train
in interfaceTrainer<DefaultObservation,DoubleCategory>
- Parameters:
trainingSet
- some training set.- Returns:
- a classifier
-
train
public SupportVectorMachine train(TrainingSet<DefaultObservation,DoubleCategory> trainingSet, ParameterSet params)Description copied from interface:Trainer
Trains a classifier on the given training set with the given parameters- Specified by:
train
in interfaceTrainer<DefaultObservation,DoubleCategory>
- Parameters:
trainingSet
- some training set.params
- parameters for the training.- Returns:
- a classifier
-
getParameterSet
Description copied from interface:Trainer
Returns the set of parameters for this trainer.- Specified by:
getParameterSet
in interfaceTrainer<DefaultObservation,DoubleCategory>
- 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<DefaultObservation,DoubleCategory>
- Parameters:
params
- a parameter set.- Returns:
- true if the operation was successful.
-
toString
-