gov.sandia.cognition.learning.algorithm.perceptron.kernel
Class OnlineKernelPerceptron<InputType>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.algorithm.AbstractBatchAndIncrementalLearner<InputOutputPair<? extends InputType,OutputType>,ResultType>
          extended by gov.sandia.cognition.learning.algorithm.AbstractSupervisedBatchAndIncrementalLearner<InputType,Boolean,DefaultKernelBinaryCategorizer<InputType>>
              extended by gov.sandia.cognition.learning.algorithm.perceptron.kernel.AbstractOnlineKernelBinaryCategorizerLearner<InputType>
                  extended by gov.sandia.cognition.learning.algorithm.perceptron.kernel.OnlineKernelPerceptron<InputType>
Type Parameters:
InputType - The input type to perform learning on, which is passed to the kernel function.
All Implemented Interfaces:
BatchAndIncrementalLearner<InputOutputPair<? extends InputType,Boolean>,DefaultKernelBinaryCategorizer<InputType>>, BatchLearner<Collection<? extends InputOutputPair<? extends InputType,Boolean>>,DefaultKernelBinaryCategorizer<InputType>>, IncrementalLearner<InputOutputPair<? extends InputType,Boolean>,DefaultKernelBinaryCategorizer<InputType>>, SupervisedBatchAndIncrementalLearner<InputType,Boolean,DefaultKernelBinaryCategorizer<InputType>>, SupervisedBatchLearner<InputType,Boolean,DefaultKernelBinaryCategorizer<InputType>>, SupervisedIncrementalLearner<InputType,Boolean,DefaultKernelBinaryCategorizer<InputType>>, KernelContainer<InputType>, CloneableSerializable, Serializable, Cloneable

public class OnlineKernelPerceptron<InputType>
extends AbstractOnlineKernelBinaryCategorizerLearner<InputType>

An implementation of the online version of the Perceptron algorithm.

Since:
3.3.0
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.sandia.cognition.learning.algorithm.perceptron.kernel.AbstractOnlineKernelBinaryCategorizerLearner
kernel
 
Constructor Summary
OnlineKernelPerceptron()
          Creates a new OnlineKernelPerceptron with no kernel.
OnlineKernelPerceptron(Kernel<? super InputType> kernel)
          Creates a new OnlineKernelPerceptron with the given kernel.
 
Method Summary
 void update(DefaultKernelBinaryCategorizer<InputType> target, InputType input, boolean label)
          Updates the target categorizer based on the given input and its associated output.
static
<InputType>
boolean
update(DefaultKernelBinaryCategorizer<InputType> target, InputType input, boolean label, boolean updateBias)
          Performs a Perceptron update step on the given target.
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.perceptron.kernel.AbstractOnlineKernelBinaryCategorizerLearner
createInitialLearnedObject, getKernel, setKernel, update
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.AbstractSupervisedBatchAndIncrementalLearner
update
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.AbstractBatchAndIncrementalLearner
clone, learn, learn, update
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 
Methods inherited from interface gov.sandia.cognition.learning.algorithm.BatchAndIncrementalLearner
learn
 
Methods inherited from interface gov.sandia.cognition.learning.algorithm.BatchLearner
learn
 
Methods inherited from interface gov.sandia.cognition.learning.algorithm.IncrementalLearner
update
 

Constructor Detail

OnlineKernelPerceptron

public OnlineKernelPerceptron()
Creates a new OnlineKernelPerceptron with no kernel.


OnlineKernelPerceptron

public OnlineKernelPerceptron(Kernel<? super InputType> kernel)
Creates a new OnlineKernelPerceptron with the given kernel.

Parameters:
kernel - The kernel function to use.
Method Detail

update

public void update(DefaultKernelBinaryCategorizer<InputType> target,
                   InputType input,
                   boolean label)
Description copied from class: AbstractOnlineKernelBinaryCategorizerLearner
Updates the target categorizer based on the given input and its associated output.

Specified by:
update in class AbstractOnlineKernelBinaryCategorizerLearner<InputType>
Parameters:
target - The target categorizer to update.
input - The input value to learn from.
label - The output value associated with the input.

update

public static <InputType> boolean update(DefaultKernelBinaryCategorizer<InputType> target,
                                         InputType input,
                                         boolean label,
                                         boolean updateBias)
Performs a Perceptron update step on the given target. If an error is made by target on the input, then the input is added as a support value to the target.

Type Parameters:
InputType - The input type to the kernel.
Parameters:
target - The kernel binary categorizer to update using the Perceptron update step.
input - The input value.
label - The label associated with the input.
updateBias - True to update the bias term. False to leave it the same.
Returns:
True if a change was made, otherwise false.