public class SDCA<T> extends java.lang.Object implements KernelSVM<T>
SDCA svm algorithm from Shalev-Shwartz.
Stochastic Dual Coordinate Ascent Methods for Regularized Loss Minimization,
Shai Shalev-Shwartz, Tong Zhang
JMLR, 2013.
Modifier and Type | Method and Description |
---|---|
Classifier<T> |
copy()
Creates and returns a copy of this object.
|
double[] |
getAlphas()
Tells the weights of training samples
|
double |
getC()
Tells the hyperparameter C
|
double |
getDualObjective() |
int |
getE()
Get the number of epochs to train the classifier
|
Kernel<T> |
getKernel()
Tells the current Kernel.
|
double |
getObjective() |
void |
setC(double c)
Sets the hyperparameter C
|
void |
setE(int e)
Set the number of epochs (going through all samples once) for the
training phase
|
void |
setKernel(Kernel<T> k)
Sets the kernel to use as similarity measure
|
void |
train(java.util.List<TrainingSample<T>> l)
Replace the current training list and train the classifier
|
void |
train(TrainingSample<T> t)
Add a single example to the current training set and train the classifier
|
double |
valueOf(T e)
Computes the category of the provided example
|
public void train(TrainingSample<T> t)
Classifier
train
in interface Classifier<T>
t
- the training samplepublic void train(java.util.List<TrainingSample<T>> l)
Classifier
train
in interface Classifier<T>
l
- list of training samplespublic double valueOf(T e)
Classifier
valueOf
in interface Classifier<T>
e
- examplepublic Classifier<T> copy() throws java.lang.CloneNotSupportedException
Classifier
copy
in interface Classifier<T>
java.lang.CloneNotSupportedException
Object.clone()
public int getE()
public void setE(int e)
e
- the number of epochspublic void setKernel(Kernel<T> k)
KernelSVM
public double[] getAlphas()
KernelSVM
public void setC(double c)
KernelSVM
public double getC()
KernelSVM
public double getObjective()
public double getDualObjective()