public abstract class PassiveAggressive extends Object implements OnlineLearningAlgorithm, BinaryLearningAlgorithm
Modifier and Type | Class and Description |
---|---|
static class |
PassiveAggressive.Policy
It is the updating policy applied by the Passive Aggressive Algorithm when a miss-prediction occurs
|
Modifier and Type | Field and Description |
---|---|
protected float |
c |
protected Label |
label |
protected PassiveAggressive.Policy |
policy |
Constructor and Description |
---|
PassiveAggressive() |
Modifier and Type | Method and Description |
---|---|
protected float |
computeWeight(Example example,
float lossValue,
float exampleSquaredNorm,
float aggressiveness) |
float |
getC() |
Label |
getLabel() |
List<Label> |
getLabels()
Returns the labels representing the concept to be learned.
|
PassiveAggressive.Policy |
getPolicy() |
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(float c) |
void |
setLabel(Label label) |
void |
setLabels(List<Label> labels)
Sets the labels representing the concept to be learned.
|
void |
setPolicy(PassiveAggressive.Policy policy) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
learn
duplicate, getPredictionFunction
protected Label label
protected PassiveAggressive.Policy policy
protected float c
public void reset()
LearningAlgorithm
reset
in interface LearningAlgorithm
public PassiveAggressive.Policy getPolicy()
public void setPolicy(PassiveAggressive.Policy policy)
policy
- the updating policy to setpublic float getC()
public void setC(float c)
c
- the aggressiveness to setprotected float computeWeight(Example example, float lossValue, float exampleSquaredNorm, float aggressiveness)
public 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 void learn(Dataset dataset)
LearningAlgorithm
dataset
learn
in interface LearningAlgorithm
dataset
- the training datapublic Label getLabel()
getLabel
in interface BinaryLearningAlgorithm
public void setLabel(Label label)
setLabel
in interface BinaryLearningAlgorithm
Copyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.