public static class OnlinePassiveAggressivePerceptron.LinearSoftMargin extends OnlinePassiveAggressivePerceptron.AbstractSoftMargin
OnlinePassiveAggressivePerceptron.AbstractSoftMargin, OnlinePassiveAggressivePerceptron.LinearSoftMargin, OnlinePassiveAggressivePerceptron.QuadraticSoftMargin
aggressiveness, DEFAULT_AGGRESSIVENESS
DEFAULT_UPDATE_BIAS
updateBias
vectorFactory
Constructor and Description |
---|
LinearSoftMargin()
Creates a new
LinearSoftMargin with default parameters. |
LinearSoftMargin(double aggressiveness)
Creates a new
LinearSoftMargin with the given
aggressiveness. |
LinearSoftMargin(double aggressiveness,
VectorFactory<?> vectorFactory)
Creates a new
LinearSoftMargin 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 LinearSoftMargin()
LinearSoftMargin
with default parameters.public LinearSoftMargin(double aggressiveness)
LinearSoftMargin
with the given
aggressiveness.aggressiveness
- The aggressiveness. Must be positive.public LinearSoftMargin(double aggressiveness, VectorFactory<?> vectorFactory)
LinearSoftMargin
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).