public class PegasosLearningAlgorithm extends Object implements LinearMethod, ClassificationLearningAlgorithm, BinaryLearningAlgorithm
[SingerICML2007] Y. Singer and N. Srebro. Pegasos: Primal estimated sub-gradient solver for SVM. In Proceeding of ICML 2007.
| Constructor and Description | 
|---|
| PegasosLearningAlgorithm() | 
| PegasosLearningAlgorithm(int k,
                        float lambda,
                        int T,
                        String Representation,
                        Label label) | 
| Modifier and Type | Method and Description | 
|---|---|
| PegasosLearningAlgorithm | duplicate()Creates a new instance of the LearningAlgorithm initialized with the same parameters
 of the learningAlgorithm to be duplicated. | 
| int | getIterations()Returns the number of iterations | 
| int | getK()Returns the number of examples k that Pegasos exploits in its 
 mini-batch learning approach | 
| Label | getLabel() | 
| List<Label> | getLabels()Returns the labels representing the concept to be learned. | 
| float | getLambda()Returns the regularization coefficient | 
| BinaryLinearClassifier | getPredictionFunction()Returns the classifier learned during the training process | 
| String | getRepresentation()Returns the representation this learning algorithm exploits | 
| void | learn(Dataset dataset)It starts the training process exploiting the provided  dataset | 
| void | reset()Resets all the learning process, returning to the default state. | 
| void | setIterations(int T)Sets the number of iterations | 
| void | setK(int k)Sets the number of examples k that Pegasos exploits in its 
 mini-batch learning approach | 
| void | setLabel(Label label) | 
| void | setLabels(List<Label> labels)Sets the labels representing the concept to be learned. | 
| void | setLambda(float lambda)Sets the regularization coefficient | 
| void | setRepresentation(String representation)Sets the representation this learning algorithm will exploit | 
public int getK()
public void setK(int k)
k - the k to setpublic int getIterations()
public void setIterations(int T)
T - the number of iterations to setpublic float getLambda()
public void setLambda(float lambda)
lambda - the lambda to setpublic String getRepresentation()
LinearMethodgetRepresentation in interface LinearMethodpublic void setRepresentation(String representation)
LinearMethodsetRepresentation in interface LinearMethodrepresentation - the representation to setpublic void learn(Dataset dataset)
LearningAlgorithmdatasetlearn in interface LearningAlgorithmdataset - the training datapublic PegasosLearningAlgorithm duplicate()
LearningAlgorithmduplicate in interface LearningAlgorithmpublic void reset()
LearningAlgorithmreset in interface LearningAlgorithmpublic BinaryLinearClassifier getPredictionFunction()
ClassificationLearningAlgorithmgetPredictionFunction in interface ClassificationLearningAlgorithmgetPredictionFunction in interface LearningAlgorithmpublic void setLabels(List<Label> labels)
LearningAlgorithmsetLabels in interface BinaryLearningAlgorithmsetLabels in interface LearningAlgorithmlabels - the labels representing the concept to be learnedpublic List<Label> getLabels()
LearningAlgorithmgetLabels in interface BinaryLearningAlgorithmgetLabels in interface LearningAlgorithmpublic Label getLabel()
getLabel in interface BinaryLearningAlgorithmpublic void setLabel(Label label)
setLabel in interface BinaryLearningAlgorithmCopyright © 2014 Semantic Analytics Group @ Uniroma2. All rights reserved.