@PublicationReference(author="Wikipedia", title="Perceptron Learning algorithm", type=WebPage, year=2008, url="http://en.wikipedia.org/wiki/Perceptron#Learning_algorithm") public class OnlinePerceptron extends AbstractLinearCombinationOnlineLearner
Perceptron
,
Serialized FormModifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_UPDATE_BIAS
By default the bias is updated.
|
updateBias
vectorFactory
Constructor and Description |
---|
OnlinePerceptron()
Creates a new
OnlinePerceptron . |
OnlinePerceptron(VectorFactory<?> vectorFactory)
Creates a new
OnlinePerceptron with the given vector factory. |
Modifier and Type | Method and Description |
---|---|
static double |
computeUpdate(boolean actualCategory,
double predicted)
Computes the update weight for the given actual category and predicted
value according to the Perceptron update rule.
|
<InputType> |
computeUpdate(DefaultKernelBinaryCategorizer<InputType> target,
InputType input,
boolean actualCategory,
double predicted)
Compute the update weight in the linear case.
|
double |
computeUpdate(LinearBinaryCategorizer target,
Vector input,
boolean label,
double predicted)
Compute the update weight in the linear case.
|
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 static final boolean DEFAULT_UPDATE_BIAS
public OnlinePerceptron()
OnlinePerceptron
.public OnlinePerceptron(VectorFactory<?> vectorFactory)
OnlinePerceptron
with the given vector factory.vectorFactory
- The vector factory to use to create the weight vectors.public double computeUpdate(LinearBinaryCategorizer target, Vector input, boolean label, double predicted)
AbstractLinearCombinationOnlineLearner
computeUpdate
in class AbstractLinearCombinationOnlineLearner
target
- Target to compute the update for.input
- Input to use in computing the update.label
- The actual category of the input.predicted
- The predicted category of the input.public <InputType> double computeUpdate(DefaultKernelBinaryCategorizer<InputType> target, InputType input, boolean actualCategory, double predicted)
AbstractLinearCombinationOnlineLearner
computeUpdate
in class AbstractLinearCombinationOnlineLearner
InputType
- The input value for learning.target
- Target to compute the update for.input
- Input to use in computing the update.actualCategory
- The actual category of the input.predicted
- The predicted category of the input.public static double computeUpdate(boolean actualCategory, double predicted)
actualCategory
- The actual category.predicted
- The predicted category.