public abstract class PassiveAggressiveClassification extends PassiveAggressive implements ClassificationLearningAlgorithm
[CrammerJLMR2006] Koby Crammer, Ofer Dekel, Joseph Keshet, Shai Shalev-Shwartz and Yoram Singer Online Passive-Aggressive Algorithms. Journal of Machine Learning Research (2006)
The standard algorithm is modified, including the fairness extention from
[FiliceECIR2014] S. Filice, G. Castellucci, D. Croce, and R. Basili. Effective Kernelized Online Learning in Language Processing Tasks. In collection of Advances in Information Retrieval, pp. 347-358, Springer International Publishing, 2014.
Modifier and Type | Class and Description |
---|---|
static class |
PassiveAggressiveClassification.Loss |
PassiveAggressive.Policy
Modifier and Type | Field and Description |
---|---|
protected BinaryClassifier |
classifier |
protected float |
cp |
protected boolean |
fairness |
protected PassiveAggressiveClassification.Loss |
loss |
c, label, policy
Constructor and Description |
---|
PassiveAggressiveClassification() |
Modifier and Type | Method and Description |
---|---|
float |
getC() |
float |
getCn() |
float |
getCp() |
PassiveAggressiveClassification.Loss |
getLoss() |
BinaryClassifier |
getPredictionFunction()
Returns the classifier learned during the training process
|
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 |
setC(float c) |
void |
setCn(float cn) |
void |
setCp(float cp) |
void |
setFairness(boolean fairness) |
void |
setLoss(PassiveAggressiveClassification.Loss loss) |
computeWeight, getLabel, getLabels, getPolicy, reset, setLabel, setLabels, setPolicy
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
duplicate, getLabels, reset, setLabels
protected PassiveAggressiveClassification.Loss loss
protected float cp
protected boolean fairness
protected BinaryClassifier classifier
public boolean isFairness()
public void setFairness(boolean fairness)
fairness
- the fairness to setpublic float getCp()
public void setCp(float cp)
cp
- the aggressiveness parameter for positive examplespublic float getCn()
public void setCn(float cn)
cn
- the aggressiveness parameter for negative examplespublic float getC()
getC
in class PassiveAggressive
public void setC(float c)
setC
in class PassiveAggressive
c
- the aggressiveness to setpublic PassiveAggressiveClassification.Loss getLoss()
public void setLoss(PassiveAggressiveClassification.Loss loss)
loss
- the loss function type to setpublic BinaryClassifier getPredictionFunction()
ClassificationLearningAlgorithm
getPredictionFunction
in interface ClassificationLearningAlgorithm
getPredictionFunction
in interface LearningAlgorithm
public BinaryMarginClassifierOutput learn(Example example)
OnlineLearningAlgorithm
learn
in interface OnlineLearningAlgorithm
example
- the instance to be exploited in the learning processexample
before the updating steppublic void learn(Dataset dataset)
LearningAlgorithm
dataset
learn
in interface LearningAlgorithm
learn
in class PassiveAggressive
dataset
- the training dataCopyright © 2015 Semantic Analytics Group @ Uniroma2. All rights reserved.