gov.sandia.cognition.learning.algorithm.perceptron.kernel
Class AbstractOnlineKernelBinaryCategorizerLearner<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>
Type Parameters:
InputType - The input value type passed to the kernel function to perform learning over.
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
Direct Known Subclasses:
AbstractOnlineBudgetedKernelBinaryCategorizerLearner, KernelBinaryCategorizerOnlineLearnerAdapter, OnlineKernelPerceptron, Projectron

public abstract class AbstractOnlineKernelBinaryCategorizerLearner<InputType>
extends AbstractSupervisedBatchAndIncrementalLearner<InputType,Boolean,DefaultKernelBinaryCategorizer<InputType>>
implements KernelContainer<InputType>

An abstract class for an online kernel binary categorizer learner.

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

Field Summary
protected  Kernel<? super InputType> kernel
          The kernel to use.
 
Constructor Summary
AbstractOnlineKernelBinaryCategorizerLearner()
          Creates a new AbstractOnlineKernelBinaryCategorizerLearner with a null kernel.
AbstractOnlineKernelBinaryCategorizerLearner(Kernel<? super InputType> kernel)
          Creates a new AbstractOnlineKernelBinaryCategorizerLearner with the given kernel.
 
Method Summary
 DefaultKernelBinaryCategorizer<InputType> createInitialLearnedObject()
          Creates a new initial learned object, before any data is given.
 Kernel<? super InputType> getKernel()
          Gets the kernel.
 void setKernel(Kernel<? super InputType> kernel)
          Sets the kernel used by this learner.
abstract  void update(DefaultKernelBinaryCategorizer<InputType> target, InputType input, boolean output)
          Updates the target categorizer based on the given input and its associated output.
 void update(DefaultKernelBinaryCategorizer<InputType> target, InputType input, Boolean output)
          The update method updates an object of ResultType using the given a new supervised input-output pair, using some form of "learning" algorithm.
 
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
 

Field Detail

kernel

protected Kernel<? super InputType> kernel
The kernel to use.

Constructor Detail

AbstractOnlineKernelBinaryCategorizerLearner

public AbstractOnlineKernelBinaryCategorizerLearner()
Creates a new AbstractOnlineKernelBinaryCategorizerLearner with a null kernel.


AbstractOnlineKernelBinaryCategorizerLearner

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

Parameters:
kernel - The kernel to use.
Method Detail

createInitialLearnedObject

public DefaultKernelBinaryCategorizer<InputType> createInitialLearnedObject()
Description copied from interface: IncrementalLearner
Creates a new initial learned object, before any data is given.

Specified by:
createInitialLearnedObject in interface IncrementalLearner<InputOutputPair<? extends InputType,Boolean>,DefaultKernelBinaryCategorizer<InputType>>
Returns:
The initial learned object.

update

public void update(DefaultKernelBinaryCategorizer<InputType> target,
                   InputType input,
                   Boolean output)
Description copied from interface: SupervisedIncrementalLearner
The update method updates an object of ResultType using the given a new supervised input-output pair, using some form of "learning" algorithm.

Specified by:
update in interface SupervisedIncrementalLearner<InputType,Boolean,DefaultKernelBinaryCategorizer<InputType>>
Parameters:
target - The object to update.
input - The supervised input to learn from.
output - The supervised output to learn from.

update

public abstract void update(DefaultKernelBinaryCategorizer<InputType> target,
                            InputType input,
                            boolean output)
Updates the target categorizer based on the given input and its associated output.

Parameters:
target - The target categorizer to update.
input - The input value to learn from.
output - The output value associated with the input.

getKernel

public Kernel<? super InputType> getKernel()
Description copied from interface: KernelContainer
Gets the kernel.

Specified by:
getKernel in interface KernelContainer<InputType>
Returns:
Internal kernel encapsulated by the KernelContainer.

setKernel

public void setKernel(Kernel<? super InputType> kernel)
Sets the kernel used by this learner.

Parameters:
kernel - The kernel to use.