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 |
setPredictionFunction(PredictionFunction predictionFunction)
Sets the predictionFunction learned during the training process.
|
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()
LearningAlgorithm
duplicate
in interface LearningAlgorithm
public float getCn()
public float getCp()
public float getEta()
public Label getLabel()
getLabel
in interface BinaryLearningAlgorithm
public List<Label> getLabels()
LearningAlgorithm
getLabels
in interface BinaryLearningAlgorithm
getLabels
in interface LearningAlgorithm
public BinaryLinearClassifier getPredictionFunction()
LearningAlgorithm
getPredictionFunction
in interface LearningAlgorithm
public String getRepresentation()
LinearMethod
getRepresentation
in interface LinearMethod
public SCWType getScwType()
public boolean isFairness()
true
if the fairness policy is activated.
false
otherwise.public void learn(Dataset dataset)
LearningAlgorithm
dataset
learn
in interface LearningAlgorithm
dataset
- the training datapublic BinaryMarginClassifierOutput learn(Example example)
OnlineLearningAlgorithm
learn
in interface OnlineLearningAlgorithm
example
- the instance to be exploited in the learning processexample
before the updating steppublic void reset()
LearningAlgorithm
reset
in interface LearningAlgorithm
public 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 BinaryLearningAlgorithm
public void setLabels(List<Label> labels)
LearningAlgorithm
setLabels
in interface BinaryLearningAlgorithm
setLabels
in interface LearningAlgorithm
labels
- the labels representing the concept to be learnedpublic void setRepresentation(String representation)
LinearMethod
setRepresentation
in interface LinearMethod
representation
- the representation to setpublic void setScwType(SCWType scwType)
scwType
- The type of SCW learning algorithm (SCW-I or SCW-II)public void setPredictionFunction(PredictionFunction predictionFunction)
LearningAlgorithm
setPredictionFunction
in interface LearningAlgorithm
Copyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.