Catalano.MachineLearning.Classification
Class MulticlassSupportVectorMachine
- java.lang.Object
-
- Catalano.MachineLearning.Classification.MulticlassSupportVectorMachine
-
- All Implemented Interfaces:
- IClassifier, java.io.Serializable, java.lang.Cloneable
public class MulticlassSupportVectorMachine extends java.lang.Object implements IClassifier, java.io.Serializable
Multiclass Support Vector Machine.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description MulticlassSupportVectorMachine(IMercerKernel kernel, double c, double[] weight)Initializes a new instance of the MulticlassSupportVectorMachine class.MulticlassSupportVectorMachine(IMercerKernel kernel, double c, double[] weight, SVM.Strategy strategy)Initializes a new instance of the MulticlassSupportVectorMachine class.MulticlassSupportVectorMachine(IMercerKernel kernel, double c, int numberOfClasses)Initializes a new instance of the MulticlassSupportVectorMachine class.MulticlassSupportVectorMachine(IMercerKernel kernel, double c, int numberOfClasses, SVM.Strategy strategy)Initializes a new instance of the MulticlassSupportVectorMachine class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description IClassifierclone()Clone of the object.voidFinish()Process support vectors until convergence.voidLearn(DatasetClassification dataset)Learn from a dataset.voidLearn(double[][] input, int[] output)Learn.voidLearn(double[] input, int output)Online learn.intPredict(double[] feature)Predict.
-
-
-
Constructor Detail
-
MulticlassSupportVectorMachine
public MulticlassSupportVectorMachine(IMercerKernel kernel, double c, int numberOfClasses)
Initializes a new instance of the MulticlassSupportVectorMachine class.- Parameters:
kernel- Mercer kernel.c- Soft margin penalty parameter.numberOfClasses- Number of classes.
-
MulticlassSupportVectorMachine
public MulticlassSupportVectorMachine(IMercerKernel kernel, double c, int numberOfClasses, SVM.Strategy strategy)
Initializes a new instance of the MulticlassSupportVectorMachine class.- Parameters:
kernel- Mercer kernel.c- Soft margin penalty parameter.numberOfClasses- Number of classes.strategy- Strategy.
-
MulticlassSupportVectorMachine
public MulticlassSupportVectorMachine(IMercerKernel kernel, double c, double[] weight)
Initializes a new instance of the MulticlassSupportVectorMachine class.- Parameters:
kernel- Mercer kernel.c- Soft margin penalty parameter.weight- Class weight.
-
MulticlassSupportVectorMachine
public MulticlassSupportVectorMachine(IMercerKernel kernel, double c, double[] weight, SVM.Strategy strategy)
Initializes a new instance of the MulticlassSupportVectorMachine class.- Parameters:
kernel- Mercer kernel.c- Soft margin penalty parameter.weight- Class weight.strategy- Strategy.
-
-
Method Detail
-
Learn
public void Learn(DatasetClassification dataset)
Description copied from interface:IClassifierLearn from a dataset.- Specified by:
Learnin interfaceIClassifier- Parameters:
dataset- Dataset.
-
Learn
public void Learn(double[][] input, int[] output)Description copied from interface:IClassifierLearn.- Specified by:
Learnin interfaceIClassifier- Parameters:
input- Matrix of features.output- Labels.
-
Learn
public void Learn(double[] input, int output)Online learn.- Parameters:
input- Feature.output- Label.
-
Predict
public int Predict(double[] feature)
Description copied from interface:IClassifierPredict.- Specified by:
Predictin interfaceIClassifier- Parameters:
feature- Feature.- Returns:
- Label.
-
clone
public IClassifier clone()
Description copied from interface:IClassifierClone of the object.- Specified by:
clonein interfaceIClassifier- Overrides:
clonein classjava.lang.Object- Returns:
- A new copy of the object.
-
Finish
public void Finish()
Process support vectors until convergence.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG