public class MulticlassSDCA<T> extends java.lang.Object implements MulticlassClassifier<T>, KernelSVM<T>
This is a straight forward extension of SDCA svm algorithm from Shalev-Shwartz to multiclass using a multiclass loss function.
Stochastic Dual Coordinate Ascent Methods for Regularized Loss Minimization,
Shai Shalev-Shwartz, Tong Zhang
JMLR, 2013.
| Constructor and Description |
|---|
MulticlassSDCA(Kernel<T> k) |
| 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 |
getConfidence(T t)
Tells the confidence associated with the predicted class
|
java.util.Map<java.lang.Integer,java.lang.Double> |
getConfidences(T t)
Tells the confidences for all classes
|
double |
getE()
return the number of epochs
|
Kernel<T> |
getKernel()
Tells the current Kernel.
|
double[][] |
getMulticlassAlphas()
Returns the matrix of dual variables in the order [sample, class]
|
void |
setC(double c)
Sets the hyperparameter C
|
void |
setE(double e)
Sets the number of epochs
|
void |
setKernel(Kernel<T> kernel)
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
|
double |
valueOf(T e)
Computes the category of the provided example
|
public void train(java.util.List<TrainingSample<T>> l)
Classifiertrain in interface Classifier<T>l - list of training samplespublic double valueOf(T e)
ClassifiervalueOf in interface Classifier<T>e - examplepublic Classifier<T> copy() throws java.lang.CloneNotSupportedException
Classifiercopy in interface Classifier<T>java.lang.CloneNotSupportedExceptionObject.clone()public double getConfidence(T t)
MulticlassClassifiergetConfidence in interface MulticlassClassifier<T>t - the sample to evaluatepublic java.util.Map<java.lang.Integer,java.lang.Double> getConfidences(T t)
MulticlassClassifiergetConfidences in interface MulticlassClassifier<T>t - the sample to evaluatepublic Kernel<T> getKernel()
KernelSVMpublic void setKernel(Kernel<T> kernel)
KernelSVMpublic double getC()
KernelSVMpublic void setC(double c)
KernelSVMpublic double getE()
public void setE(double e)
e - public double[] getAlphas()
KernelSVMpublic double[][] getMulticlassAlphas()