public class SoftConfidenceWeightedClassification extends Object implements OnlineLearningAlgorithm, BinaryLearningAlgorithm, LinearMethod
| Modifier and Type | Field and Description |
|---|---|
protected BinaryClassifier |
classifier |
protected float |
phi
Phi is the standard score computed from the confidence.
|
| Constructor and Description |
|---|
SoftConfidenceWeightedClassification() |
SoftConfidenceWeightedClassification(Label label,
SCWType scwType,
float eta,
float cp,
float cn,
boolean fairness,
String representationName) |
SoftConfidenceWeightedClassification(SCWType scwType,
float eta,
float cp,
float cn,
String representationName) |
| Modifier and Type | Method and Description |
|---|---|
SoftConfidenceWeightedClassification |
duplicate()
Creates a new instance of the LearningAlgorithm initialized with the same parameters
of the learningAlgorithm to be duplicated.
|
float |
getCn() |
float |
getCp() |
float |
getEta() |
Label |
getLabel() |
List<Label> |
getLabels()
Returns the labels representing the concept to be learned.
|
BinaryLinearClassifier |
getPredictionFunction()
Returns the predictionFunction learned during the training process
|
String |
getRepresentation()
Returns the representation this learning algorithm exploits
|
SCWType |
getScwType() |
boolean |
isFairness() |
void |
learn(Dataset dataset)
It starts the training process exploiting the provided
dataset |
BinaryMarginClassifierOutput |
learn(Example example)
Applies the learning process on a single example, updating its current model
|
void |
reset()
Resets all the learning process, returning to the default state.
|
void |
setCn(float cn) |
void |
setCp(float cp) |
void |
setEta(float eta) |
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
|
void |
setScwType(SCWType scwType) |
protected BinaryClassifier classifier
protected float phi
public SoftConfidenceWeightedClassification()
public SoftConfidenceWeightedClassification(SCWType scwType, float eta, float cp, float cn, String representationName)
scwType - The label to be learnedeta - The probability of correct classification required for the
updated distribution on the current instancecp - Tradeoff parameters for positive examples between the
passiveness and aggressiveness classification.cn - Tradeoff parameters for negative examples between the
passiveness and aggressiveness classification.representationName - The identifier of the representation to be considered for the
training steppublic SoftConfidenceWeightedClassification(Label label, SCWType scwType, float eta, float cp, float cn, boolean fairness, String representationName)
label - The label to be learnedscwType - The label to be learnedeta - The probability of correct classification required for the
updated distribution on the current instancecp - Tradeoff parameters for positive examples between the
passiveness and aggressiveness classification.cn - Tradeoff parameters for negative examples between the
passiveness and aggressiveness classification.fairness - A boolean parameter to force the fairness policyrepresentationName - The identifier of the representation to be considered for the
training steppublic SoftConfidenceWeightedClassification duplicate()
LearningAlgorithmduplicate in interface LearningAlgorithmpublic float getCn()
public float getCp()
public float getEta()
public Label getLabel()
getLabel in interface BinaryLearningAlgorithmpublic List<Label> getLabels()
LearningAlgorithmgetLabels in interface BinaryLearningAlgorithmgetLabels in interface LearningAlgorithmpublic BinaryLinearClassifier getPredictionFunction()
LearningAlgorithmgetPredictionFunction in interface LearningAlgorithmpublic String getRepresentation()
LinearMethodgetRepresentation in interface LinearMethodpublic SCWType getScwType()
public boolean isFairness()
true if the fairness policy is activated.
false otherwise.public void learn(Dataset dataset)
LearningAlgorithmdatasetlearn in interface LearningAlgorithmdataset - the training datapublic BinaryMarginClassifierOutput learn(Example example)
OnlineLearningAlgorithmlearn in interface OnlineLearningAlgorithmexample - the instance to be exploited in the learning processexample before the updating steppublic void reset()
LearningAlgorithmreset in interface LearningAlgorithmpublic void setCn(float cn)
cn - Tradeoff parameters for negative examples between the
passiveness and aggressiveness classification.public void setCp(float cp)
cp - Tradeoff parameters for positive examples between the
passiveness and aggressiveness classification.public void setEta(float eta)
eta - The probability of correct classification required for the
updated distribution on the current instancepublic void setFairness(boolean fairness)
fairness - Set the fairness policypublic void setLabel(Label label)
setLabel in interface BinaryLearningAlgorithmpublic void setLabels(List<Label> labels)
LearningAlgorithmsetLabels in interface BinaryLearningAlgorithmsetLabels in interface LearningAlgorithmlabels - the labels representing the concept to be learnedpublic void setRepresentation(String representation)
LinearMethodsetRepresentation in interface LinearMethodrepresentation - the representation to setpublic void setScwType(SCWType scwType)
scwType - The type of SCW learning algorithm (SCW-I or SCW-II)Copyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.