public class SVMnoBias extends SupportVectorLearner implements BinaryScoreClassifier
normalized
kernel. If the given
kernel is not normalized, this class will automatically wrap it to become
normalized.SupportVectorLearner.CacheMode
Modifier and Type | Field and Description |
---|---|
protected short[] |
label
Stores the true label value (-1 or +1) of the data point
|
protected Vec |
weights
Weight values to apply to each data point
|
accelCache, alphas, cacheEvictions, evalCount, vecs
Constructor and Description |
---|
SVMnoBias(KernelTrick kf)
Creates a new SVM object that uses no cache mode.
|
SVMnoBias(SVMnoBias toCopy) |
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
SVMnoBias |
clone() |
double |
getC()
Returns the soft margin complexity parameter of the SVM
|
double |
getScore(DataPoint dp)
Returns the numeric score for predicting a class of a given data point,
where the sign of the value indicates which class the data point is
predicted to belong to.
|
double |
getTolerance()
Returns the solution tolerance
|
void |
setC(double C)
Sets the complexity parameter of SVM.
|
void |
setKernel(KernelTrick kernel)
Sets the kernel trick to use
|
void |
setTolerance(double tolerance)
Sets the tolerance for the solution.
|
boolean |
supportsWeightedData()
Indicates whether the model knows how to train using weighted data points.
|
void |
trainC(ClassificationDataSet dataSet)
Trains the classifier and constructs a model for classification using the
given data set.
|
protected void |
trainC(ClassificationDataSet dataSet,
double[] warm_start) |
protected void |
trainC(ClassificationDataSet dataSet,
double[] warm_start,
ExecutorService ex) |
void |
trainC(ClassificationDataSet dataSet,
ExecutorService threadPool)
Trains the classifier and constructs a model for classification using the
given data set.
|
accessingRow, getCacheMode, getCacheValue, getKernel, k, kEval, kEval, kEvalSum, setAlphas, setCacheMode, setCacheSize, setCacheValue, sparsify
protected short[] label
protected Vec weights
public SVMnoBias(KernelTrick kf)
kf
- the kernel trick to usepublic SVMnoBias(SVMnoBias toCopy)
public void setKernel(KernelTrick kernel)
SupportVectorLearner
setKernel
in class SupportVectorLearner
kernel
- the kernel trick to usepublic double getScore(DataPoint dp)
BinaryScoreClassifier
getScore
in interface BinaryScoreClassifier
dp
- the data point to predict the class label ofpublic SVMnoBias clone()
clone
in interface BinaryScoreClassifier
clone
in interface Classifier
clone
in class Object
public CategoricalResults classify(DataPoint data)
Classifier
classify
in interface Classifier
data
- the data point to classifypublic void trainC(ClassificationDataSet dataSet)
Classifier
trainC
in interface Classifier
dataSet
- the data set to train onpublic void trainC(ClassificationDataSet dataSet, ExecutorService threadPool)
Classifier
trainC
in interface Classifier
dataSet
- the data set to train onthreadPool
- the source of threads to use.protected void trainC(ClassificationDataSet dataSet, double[] warm_start)
dataSet
- the dataset to train onwarm_start
- Array of initial alpha values to use for support
vectors. The absolute value of the inputs will be used. may be longer
than the number of data points.protected void trainC(ClassificationDataSet dataSet, double[] warm_start, ExecutorService ex)
public boolean supportsWeightedData()
Classifier
supportsWeightedData
in interface Classifier
public void setC(double C)
C
- the soft margin parameterpublic double getC()
public void setTolerance(double tolerance)
tolerance
- the tolerance for the solutionpublic double getTolerance()
Copyright © 2017. All rights reserved.