gov.sandia.cognition.learning.algorithm.perceptron
Class AbstractKernelizableBinaryCategorizerOnlineLearner

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<Vectorizable,Boolean,LinearBinaryCategorizer>
              extended by gov.sandia.cognition.learning.algorithm.perceptron.AbstractOnlineLinearBinaryCategorizerLearner
                  extended by gov.sandia.cognition.learning.algorithm.perceptron.AbstractKernelizableBinaryCategorizerOnlineLearner
All Implemented Interfaces:
BatchAndIncrementalLearner<InputOutputPair<? extends Vectorizable,Boolean>,LinearBinaryCategorizer>, BatchLearner<Collection<? extends InputOutputPair<? extends Vectorizable,Boolean>>,LinearBinaryCategorizer>, IncrementalLearner<InputOutputPair<? extends Vectorizable,Boolean>,LinearBinaryCategorizer>, KernelizableBinaryCategorizerOnlineLearner, SupervisedBatchAndIncrementalLearner<Vectorizable,Boolean,LinearBinaryCategorizer>, SupervisedBatchLearner<Vectorizable,Boolean,LinearBinaryCategorizer>, SupervisedIncrementalLearner<Vectorizable,Boolean,LinearBinaryCategorizer>, VectorFactoryContainer, CloneableSerializable, Serializable, Cloneable
Direct Known Subclasses:
AbstractLinearCombinationOnlineLearner, AggressiveRelaxedOnlineMaximumMarginAlgorithm, Ballseptron, RelaxedOnlineMaximumMarginAlgorithm

public abstract class AbstractKernelizableBinaryCategorizerOnlineLearner
extends AbstractOnlineLinearBinaryCategorizerLearner
implements KernelizableBinaryCategorizerOnlineLearner

An abstract implementation of the KernelizableBinaryCategorizerOnlineLearner interface. It handles a lot of the convenience methods to string them together, making it necessary for sub-classes to only implement one update method.

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

Field Summary
 
Fields inherited from class gov.sandia.cognition.learning.algorithm.perceptron.AbstractOnlineLinearBinaryCategorizerLearner
vectorFactory
 
Constructor Summary
AbstractKernelizableBinaryCategorizerOnlineLearner()
          Creates a new AbstractKernelizableBinaryCategorizerOnlineLearner.
AbstractKernelizableBinaryCategorizerOnlineLearner(VectorFactory<?> vectorFactory)
          Creates a new AbstractKernelizableBinaryCategorizerOnlineLearner with the given vector factory.
 
Method Summary
<InputType>
DefaultKernelBinaryCategorizer<InputType>
createInitialLearnedObject(Kernel<? super InputType> kernel)
          Creates the initial learned object with a given kernel.
<InputType>
SupervisedBatchAndIncrementalLearner<InputType,Boolean,DefaultKernelBinaryCategorizer<InputType>>
createKernelLearner(Kernel<? super InputType> kernel)
          Creates a new kernel-based learner using the standard learning interfaces based on this learner and its parameters.
<InputType>
DefaultKernelBinaryCategorizer<InputType>
learn(Kernel<? super InputType> kernel, Iterable<? extends InputOutputPair<? extends InputType,Boolean>> data)
          Run this algorithm on a batch of data using the given kernel function.
<InputType>
void
update(DefaultKernelBinaryCategorizer<InputType> target, InputOutputPair<? extends InputType,Boolean> data)
          Performs a kernel-based incremental update step on the given object using the given supervised data.
<InputType>
void
update(DefaultKernelBinaryCategorizer<InputType> target, InputType input, Boolean output)
          Performs a kernel-based incremental update step on the given object using the given supervised data.
<InputType>
void
update(DefaultKernelBinaryCategorizer<InputType> target, Iterable<? extends InputOutputPair<? extends InputType,Boolean>> data)
          Performs a kernel-based incremental update step on the given object using the given supervised data.
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.perceptron.AbstractOnlineLinearBinaryCategorizerLearner
createInitialLearnedObject, getVectorFactory, setVectorFactory, update, 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.learning.algorithm.perceptron.KernelizableBinaryCategorizerOnlineLearner
update
 
Methods inherited from interface gov.sandia.cognition.learning.algorithm.SupervisedIncrementalLearner
update
 
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
createInitialLearnedObject, update, update
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Constructor Detail

AbstractKernelizableBinaryCategorizerOnlineLearner

public AbstractKernelizableBinaryCategorizerOnlineLearner()
Creates a new AbstractKernelizableBinaryCategorizerOnlineLearner.


AbstractKernelizableBinaryCategorizerOnlineLearner

public AbstractKernelizableBinaryCategorizerOnlineLearner(VectorFactory<?> vectorFactory)
Creates a new AbstractKernelizableBinaryCategorizerOnlineLearner with the given vector factory.

Parameters:
vectorFactory - The vector factory to use.
Method Detail

createInitialLearnedObject

public <InputType> DefaultKernelBinaryCategorizer<InputType> createInitialLearnedObject(Kernel<? super InputType> kernel)
Description copied from interface: KernelizableBinaryCategorizerOnlineLearner
Creates the initial learned object with a given kernel.

Specified by:
createInitialLearnedObject in interface KernelizableBinaryCategorizerOnlineLearner
Type Parameters:
InputType - The input type for supervised learning. Will be passed to the kernel function.
Parameters:
kernel - The kernel function to use.
Returns:
A new, empty learned object.

update

public <InputType> void update(DefaultKernelBinaryCategorizer<InputType> target,
                               Iterable<? extends InputOutputPair<? extends InputType,Boolean>> data)
Description copied from interface: KernelizableBinaryCategorizerOnlineLearner
Performs a kernel-based incremental update step on the given object using the given supervised data.

Specified by:
update in interface KernelizableBinaryCategorizerOnlineLearner
Type Parameters:
InputType - The input type for supervised learning. Will be passed to the kernel function.
Parameters:
target - The target object to update.
data - The supervised training data.

update

public <InputType> void update(DefaultKernelBinaryCategorizer<InputType> target,
                               InputOutputPair<? extends InputType,Boolean> data)
Description copied from interface: KernelizableBinaryCategorizerOnlineLearner
Performs a kernel-based incremental update step on the given object using the given supervised data.

Specified by:
update in interface KernelizableBinaryCategorizerOnlineLearner
Type Parameters:
InputType - The input type for supervised learning. Will be passed to the kernel function.
Parameters:
target - The target object to update.
data - The supervised training data.

update

public <InputType> void update(DefaultKernelBinaryCategorizer<InputType> target,
                               InputType input,
                               Boolean output)
Description copied from interface: KernelizableBinaryCategorizerOnlineLearner
Performs a kernel-based incremental update step on the given object using the given supervised data.

Specified by:
update in interface KernelizableBinaryCategorizerOnlineLearner
Type Parameters:
InputType - The input type for supervised learning. Will be passed to the kernel function.
Parameters:
target - The target object to update.
input - The supervised input value.
output - The supervised output value (label).

learn

public <InputType> DefaultKernelBinaryCategorizer<InputType> learn(Kernel<? super InputType> kernel,
                                                                   Iterable<? extends InputOutputPair<? extends InputType,Boolean>> data)
Description copied from interface: KernelizableBinaryCategorizerOnlineLearner
Run this algorithm on a batch of data using the given kernel function.

Specified by:
learn in interface KernelizableBinaryCategorizerOnlineLearner
Type Parameters:
InputType - The input type for supervised learning. Will be passed to the kernel function.
Parameters:
kernel - The kernel function to use.
data - The supervised training data.
Returns:
A new object trained on the given data.

createKernelLearner

public <InputType> SupervisedBatchAndIncrementalLearner<InputType,Boolean,DefaultKernelBinaryCategorizer<InputType>> createKernelLearner(Kernel<? super InputType> kernel)
Description copied from interface: KernelizableBinaryCategorizerOnlineLearner
Creates a new kernel-based learner using the standard learning interfaces based on this learner and its parameters.

Specified by:
createKernelLearner in interface KernelizableBinaryCategorizerOnlineLearner
Type Parameters:
InputType - The input type for supervised learning. Will be passed to the kernel function.
Parameters:
kernel - The kernel function to use.
Returns:
A kernel-based version of this learning algorithm.