public class CSKLRBatch extends SupportVectorLearner implements Parameterized, Classifier
CSKLR.UpdateMode.NC
mode if model
sparsity is not important.
learning rate
and gamma
variables. They behave different compared to many algorithms.
SupportVectorLearner.CacheMode
Modifier and Type | Field and Description |
---|---|
protected double |
gamma |
accelCache, alphas, cacheEvictions, evalCount, vecs
Modifier | Constructor and Description |
---|---|
protected |
CSKLRBatch(CSKLRBatch toClone)
Copy constructor
|
|
CSKLRBatch(double eta,
KernelTrick kernel,
double R,
CSKLR.UpdateMode mode,
SupportVectorLearner.CacheMode cacheMode)
Creates a new SCKLR Batch learning object
|
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
CSKLRBatch |
clone() |
int |
getEpochs()
Returns the number of passes through the data set
|
double |
getEta()
Returns the learning rate to use
|
double |
getGamma()
Returns the gamma sparsity parameter value
|
CSKLR.UpdateMode |
getMode()
Returns the update mode in use
|
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 |
getR()
Returns the maximal norm of the algorithm
|
static Distribution |
guessR(DataSet d)
Guesses the distribution to use for the R parameter
|
void |
setEpochs(int epochs)
Sets the number of training epochs (passes) through the data set
|
void |
setEta(double eta)
Sets the learning rate to use for the algorithm.
|
void |
setGamma(double gamma)
Sets the gamma value to use.
|
void |
setMode(CSKLR.UpdateMode mode)
Sets what update mode should be used.
|
void |
setR(double R)
Sets the maximal margin norm value for the algorithm.
|
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 CSKLRBatch(double eta, KernelTrick kernel, double R, CSKLR.UpdateMode mode, SupportVectorLearner.CacheMode cacheMode)
eta
- the learning rate to usekernel
- the kernel to useR
- the maximal norm of the surfacemode
- the mode to usecacheMode
- the kernel caching mode to useprotected CSKLRBatch(CSKLRBatch toClone)
toClone
- the object to copypublic CSKLRBatch clone()
clone
in interface Classifier
clone
in class Object
public void setEpochs(int epochs)
epochs
- the number of passes through the data setpublic int getEpochs()
public void setEta(double eta)
eta
- the positive learning rate to usepublic double getEta()
public void setR(double R)
R
- public double getR()
public void setMode(CSKLR.UpdateMode mode)
setGamma(double)
mode
- the update mode to usepublic CSKLR.UpdateMode getMode()
public void setGamma(double gamma)
CSKLR.UpdateMode
is used, controls the sparsity of the model.gamma
- the gamma parameter, which is at least always positivepublic double getGamma()
public static Distribution guessR(DataSet d)
d
- the dataset to get the guess forsetR(double)
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 obtainpublic CategoricalResults classify(DataPoint data)
Classifier
classify
in interface Classifier
data
- the data point to classifypublic 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
Copyright © 2017. All rights reserved.