Catalano.MachineLearning.Classification
Class SupportVectorMachine
- java.lang.Object
-
- Catalano.MachineLearning.Classification.SupportVectorMachine
-
- All Implemented Interfaces:
- IClassifier, java.io.Serializable, java.lang.Cloneable
public class SupportVectorMachine extends java.lang.Object implements IClassifier, java.io.Serializable
Support Vector Machine.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description SupportVectorMachine(IMercerKernel kernel, double c)Initializes a new instance of the SupportVectorMachine class.SupportVectorMachine(IMercerKernel kernel, double c, double cn)Initializes a new instance of the SupportVectorMachine class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description IClassifierclone()Clone of the object.voidFinish()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
-
SupportVectorMachine
public SupportVectorMachine(IMercerKernel kernel, double c)
Initializes a new instance of the SupportVectorMachine class.- Parameters:
kernel- Mercer kernel.c- Soft margin penalty parameter.
-
SupportVectorMachine
public SupportVectorMachine(IMercerKernel kernel, double c, double cn)
Initializes a new instance of the SupportVectorMachine class.- Parameters:
kernel- Mercer kernel.c- Soft margin penalty parameter for positive instances.cn- Soft margin penalty parameter for negative instances.
-
-
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()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG