public class DCSVM extends SupportVectorLearner implements Classifier, Parameterized
SVMnoBias
, meaning this code
does not have a bias term and it only works with normalized kernels. Any
non-normalized kernel will be normalized automatically. This is not a problem
for the common RBF kernel.SupportVectorLearner.CacheMode
accelCache, alphas, cacheEvictions, evalCount, vecs
Constructor and Description |
---|
DCSVM()
Creates a new DC-SVM for the RBF kernel
|
DCSVM(DCSVM toCopy)
Copy Constructor
|
DCSVM(KernelTrick k)
Creates a new DC-SVM for the given kernel
|
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
DCSVM |
clone() |
double |
getC()
Returns the soft margin complexity parameter of the SVM
|
int |
getClusterSampleSize() |
int |
getEndLevel() |
Parameter |
getParameter(String paramName)
Returns the parameter with the given name.
|
List<Parameter> |
getParameters()
Returns the list of parameters that can be altered for this learner.
|
double |
getScore(DataPoint dp) |
int |
getStartLevel() |
void |
setC(double C)
Sets the complexity parameter of SVM.
|
void |
setClusterSampleSize(int m)
At each level of the DC-SVM training, a clustering algorithm is used to
divide the dataset into sub-groups for independent training.
|
void |
setEndLevel(int l_early)
The DC-SVM algorithm works by creating a hierarchy of levels, and
iteratively refining the solution from one level to the next.
|
void |
setStartLevel(int l_max)
The DC-SVM algorithm works by creating a hierarchy of levels, and
iteratively refining the solution from one level to the next.
|
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.
|
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, setKernel, sparsify
public DCSVM(KernelTrick k)
k
- the kernel to usepublic DCSVM()
public DCSVM(DCSVM toCopy)
toCopy
- object to copypublic void setStartLevel(int l_max)
l_max
- which level to start the training at.public int getStartLevel()
public void setEndLevel(int l_early)
l_early
- which level to stop the training at, and use for
classification.public int getEndLevel()
public void setClusterSampleSize(int m)
m
- the number of data points to sample for each cluster sizepublic int getClusterSampleSize()
public CategoricalResults classify(DataPoint data)
Classifier
classify
in interface Classifier
data
- the data point to classifypublic double getScore(DataPoint dp)
public void trainC(ClassificationDataSet dataSet, ExecutorService threadPool)
Classifier
trainC
in interface Classifier
dataSet
- the data set to train onthreadPool
- the source of threads to use.public void trainC(ClassificationDataSet dataSet)
Classifier
trainC
in interface Classifier
dataSet
- the data set to train onpublic boolean supportsWeightedData()
Classifier
supportsWeightedData
in interface Classifier
public DCSVM clone()
clone
in interface Classifier
clone
in class Object
public void setC(double C)
C
- the soft margin parameterpublic double getC()
public List<Parameter> getParameters()
Parameterized
getParameters
in interface Parameterized
public Parameter getParameter(String paramName)
Parameterized
getParameter
in interface Parameterized
paramName
- the name of the parameter to obtainCopyright © 2017. All rights reserved.