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 |
setPredictionFunction(PredictionFunction predictionFunction)
Sets the predictionFunction learned during the training process.
|
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()
LinearMethod
getRepresentation
in interface LinearMethod
public void setRepresentation(String representation)
LinearMethod
setRepresentation
in interface LinearMethod
representation
- 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)
LearningAlgorithm
setLabels
in interface BinaryLearningAlgorithm
setLabels
in interface LearningAlgorithm
labels
- the labels representing the concept to be learnedpublic List<Label> getLabels()
LearningAlgorithm
getLabels
in interface BinaryLearningAlgorithm
getLabels
in interface LearningAlgorithm
public Label getLabel()
getLabel
in interface BinaryLearningAlgorithm
public void setLabel(Label label)
setLabel
in interface BinaryLearningAlgorithm
public void learn(Dataset dataset)
LearningAlgorithm
dataset
learn
in interface LearningAlgorithm
dataset
- the training datapublic LibLinearLearningAlgorithm duplicate()
LearningAlgorithm
duplicate
in interface LearningAlgorithm
public void reset()
LearningAlgorithm
reset
in interface LearningAlgorithm
public BinaryLinearClassifier getPredictionFunction()
ClassificationLearningAlgorithm
getPredictionFunction
in interface ClassificationLearningAlgorithm
getPredictionFunction
in interface LearningAlgorithm
public void setPredictionFunction(PredictionFunction predictionFunction)
LearningAlgorithm
setPredictionFunction
in interface LearningAlgorithm
Copyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.