public static class OnlinePassiveAggressivePerceptron.QuadraticSoftMargin extends OnlinePassiveAggressivePerceptron.AbstractSoftMargin
OnlinePassiveAggressivePerceptron.AbstractSoftMargin, OnlinePassiveAggressivePerceptron.LinearSoftMargin, OnlinePassiveAggressivePerceptron.QuadraticSoftMargin
aggressiveness, DEFAULT_AGGRESSIVENESS
DEFAULT_UPDATE_BIAS
updateBias
vectorFactory
Constructor and Description |
---|
QuadraticSoftMargin()
Creates a new
QuadraticSoftMargin with default parameters. |
QuadraticSoftMargin(double aggressiveness)
Creates a new
QuadraticSoftMargin with the given
aggressiveness. |
QuadraticSoftMargin(double aggressiveness,
VectorFactory<?> vectorFactory)
Creates a new
QuadraticSoftMargin with the given parameters. |
Modifier and Type | Method and Description |
---|---|
protected double |
computeUpdate(double actual,
double predicted,
double loss,
double inputNorm2Squared)
Compute the update value (tau) for the algorithm.
|
getAggressiveness, setAggressiveness
computeUpdate, computeUpdate
computeDecay, computeDecay, computeRescaling, computeRescaling, createInitialLearnedObject, initialize, initialize, isUpdateBias, setUpdateBias, update, update
createKernelLearner, learn, update, update, update
createInitialLearnedObject, getVectorFactory, setVectorFactory, update
update
clone, learn, learn, update
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
update
learn
learn
createInitialLearnedObject, update, update
clone
public QuadraticSoftMargin()
QuadraticSoftMargin
with default parameters.public QuadraticSoftMargin(double aggressiveness)
QuadraticSoftMargin
with the given
aggressiveness.aggressiveness
- The aggressiveness. Must be positive.public QuadraticSoftMargin(double aggressiveness, VectorFactory<?> vectorFactory)
QuadraticSoftMargin
with the given parameters.aggressiveness
- The aggressiveness. Must be positive.vectorFactory
- The factory to use to create new weight vectors.protected double computeUpdate(double actual, double predicted, double loss, double inputNorm2Squared)
OnlinePassiveAggressivePerceptron
computeUpdate
in class OnlinePassiveAggressivePerceptron
actual
- The actual label represented as a double (-1 or +1).predicted
- The value predicted by the current categorizer (w * x + b).loss
- The loss function (1 - predicted).inputNorm2Squared
- The squared 2-norm of the input (||x||^2).