@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 Form| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_UPDATE_BIAS
By default the bias is updated.
|
updateBiasvectorFactory| 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, updatecreateKernelLearner, learn, update, update, updatecreateInitialLearnedObject, getVectorFactory, setVectorFactory, updateupdateclone, learn, learn, updateequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitupdatelearnlearncreateInitialLearnedObject, update, updateclonepublic 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)
AbstractLinearCombinationOnlineLearnercomputeUpdate in class AbstractLinearCombinationOnlineLearnertarget - 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)
AbstractLinearCombinationOnlineLearnercomputeUpdate in class AbstractLinearCombinationOnlineLearnerInputType - 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.