Class MultiClassRbfTrainer
- java.lang.Object
-
- net.sf.tweety.machinelearning.svm.MultiClassRbfTrainer
-
- All Implemented Interfaces:
Trainer<DefaultObservation,DoubleCategory>
public class MultiClassRbfTrainer extends java.lang.Object implements Trainer<DefaultObservation,DoubleCategory>
Trains a standard multi-class RBF support vector machine.- Author:
- Matthias Thimm
-
-
Field Summary
Fields Modifier and Type Field Description static TrainingParameter
C_PARAMETER
The c parameter for learningstatic TrainingParameter
GAMMA_PARAMETER
The gamma parameter for learning
-
Constructor Summary
Constructors Constructor Description MultiClassRbfTrainer()
Initializes the trainer with the default parameters.MultiClassRbfTrainer(double c, double gamma)
Initializes the trainer with the given parameters.
-
Method Summary
Modifier and Type Method Description ParameterSet
getParameterSet()
Returns 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.java.lang.String
toString()
SupportVectorMachine
train(TrainingSet<DefaultObservation,DoubleCategory> trainingSet)
Trains a classifier on the given training set.SupportVectorMachine
train(TrainingSet<DefaultObservation,DoubleCategory> trainingSet, ParameterSet params)
Trains a classifier on the given training set with the given parameters
-
-
-
Field Detail
-
C_PARAMETER
public static final TrainingParameter C_PARAMETER
The c parameter for learning
-
GAMMA_PARAMETER
public static final TrainingParameter GAMMA_PARAMETER
The gamma parameter for learning
-
-
Constructor Detail
-
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 Detail
-
train
public SupportVectorMachine train(TrainingSet<DefaultObservation,DoubleCategory> trainingSet)
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
public ParameterSet 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
public boolean setParameterSet(ParameterSet params)
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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-