public class LibLinearLearningAlgorithm extends Object implements LinearMethod, ClassificationLearningAlgorithm, BinaryLearningAlgorithm
Further details can be found in:
[Fan et al, 2008] R.-E. Fan, K.-W. Chang, C.-J. Hsieh, X.-R. Wang, and C.-J. Lin. LIBLINEAR: A Library for Large Linear Classification, Journal of Machine Learning Research 9(2008), 1871-1874. Software available at
The original LIBLINEAR code:
http://www.csie.ntu.edu.tw/~cjlin/liblinear
The original JAVA porting (v 1.94): http://liblinear.bwaldvogel.de
| Constructor and Description |
|---|
LibLinearLearningAlgorithm() |
LibLinearLearningAlgorithm(double cp,
double cn,
String representationName) |
LibLinearLearningAlgorithm(Label label,
double cp,
double cn,
boolean fairness,
String representationName) |
LibLinearLearningAlgorithm(Label label,
double cp,
double cn,
String representationName) |
| Modifier and Type | Method and Description |
|---|---|
LibLinearLearningAlgorithm |
duplicate()
Creates a new instance of the LearningAlgorithm initialized with the same parameters
of the learningAlgorithm to be duplicated.
|
double |
getCn() |
double |
getCp() |
Label |
getLabel() |
List<Label> |
getLabels()
Returns the labels representing the concept to be learned.
|
BinaryLinearClassifier |
getPredictionFunction()
Returns the classifier learned during the training process
|
String |
getRepresentation()
Returns the representation this learning algorithm exploits
|
boolean |
isFairness() |
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 |
setC(double c) |
void |
setCn(double cn) |
void |
setCp(double cp) |
void |
setFairness(boolean fairness) |
void |
setLabel(Label label) |
void |
setLabels(List<Label> labels)
Sets the labels representing the concept to be learned.
|
void |
setRepresentation(String representation)
Sets the representation this learning algorithm will exploit
|
public LibLinearLearningAlgorithm(Label label, double cp, double cn, String representationName)
label - The label to be learnedcp - The regularization parameter for positive examplescn - The regularization parameter for negative examplesrepresentationName - The identifier of the representation to be considered for the
training steppublic LibLinearLearningAlgorithm(Label label, double cp, double cn, boolean fairness, String representationName)
label - The label to be learnedcp - The regularization parameter for positive examplescn - The regularization parameter for negative examplesfairness - A boolean parameter to force the fairness policyrepresentationName - The identifier of the representation to be considered for the
training steppublic LibLinearLearningAlgorithm(double cp,
double cn,
String representationName)
cp - The regularization parameter for positive examplescn - The regularization parameter for negative examplesrepresentationName - The identifier of the representation to be considered for the
training steppublic LibLinearLearningAlgorithm()
public double getCp()
public void setCp(double cp)
cp - the regularization parameter to set for positive examplespublic double getCn()
public void setCn(double cn)
cn - the regularization parameter to set for negative examplespublic void setC(double c)
c - the regularization parameter to set for both positive and negative examplespublic String getRepresentation()
LinearMethodgetRepresentation in interface LinearMethodpublic void setRepresentation(String representation)
LinearMethodsetRepresentation in interface LinearMethodrepresentation - the representation to setpublic boolean isFairness()
public void setFairness(boolean fairness)
fairness - Set the boolean parameter to force the fairness policypublic 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 BinaryLearningAlgorithmpublic void learn(Dataset dataset)
LearningAlgorithmdatasetlearn in interface LearningAlgorithmdataset - the training datapublic LibLinearLearningAlgorithm duplicate()
LearningAlgorithmduplicate in interface LearningAlgorithmpublic void reset()
LearningAlgorithmreset in interface LearningAlgorithmpublic BinaryLinearClassifier getPredictionFunction()
ClassificationLearningAlgorithmgetPredictionFunction in interface ClassificationLearningAlgorithmgetPredictionFunction in interface LearningAlgorithmCopyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.