gov.sandia.cognition.learning.algorithm.perceptron.kernel
Class KernelBinaryCategorizerOnlineLearnerAdapter<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.KernelBinaryCategorizerOnlineLearnerAdapter<InputType>
Type Parameters:
InputType - The input type to perform learning over. It 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 KernelBinaryCategorizerOnlineLearnerAdapter<InputType>
extends AbstractOnlineKernelBinaryCategorizerLearner<InputType>

A wrapper class for a KernelizableBinaryCategorizerOnlineLearner that allows it to be used as a batch or incremental learner over the input type directly, rather than using utility methods.

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

Field Summary
protected  KernelizableBinaryCategorizerOnlineLearner learner
          The wrapped kernelizable learner.
 
Fields inherited from class gov.sandia.cognition.learning.algorithm.perceptron.kernel.AbstractOnlineKernelBinaryCategorizerLearner
kernel
 
Constructor Summary
KernelBinaryCategorizerOnlineLearnerAdapter()
          Creates a new KernelBinaryCategorizerOnlineLearnerAdapter with a null learner.
KernelBinaryCategorizerOnlineLearnerAdapter(Kernel<? super InputType> kernel, KernelizableBinaryCategorizerOnlineLearner learner)
          Creates a new KernelBinaryCategorizerOnlineLearnerAdapter with the given kernel and learner.
 
Method Summary
 DefaultKernelBinaryCategorizer<InputType> createInitialLearnedObject()
          Creates a new initial learned object, before any data is given.
 KernelizableBinaryCategorizerOnlineLearner getLearner()
          Gets the kernelizable learner that this adapter is wrapping.
 void setLearner(KernelizableBinaryCategorizerOnlineLearner learner)
          Sets the kernelizable learner that this adapter is wrapping.
 void update(DefaultKernelBinaryCategorizer<InputType> target, InputOutputPair<? extends InputType,Boolean> data)
          The update method updates an object of ResultType using the given new data of type DataType, using some form of "learning" algorithm.
 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.perceptron.kernel.AbstractOnlineKernelBinaryCategorizerLearner
getKernel, setKernel
 
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

learner

protected KernelizableBinaryCategorizerOnlineLearner learner
The wrapped kernelizable learner.

Constructor Detail

KernelBinaryCategorizerOnlineLearnerAdapter

public KernelBinaryCategorizerOnlineLearnerAdapter()
Creates a new KernelBinaryCategorizerOnlineLearnerAdapter with a null learner.


KernelBinaryCategorizerOnlineLearnerAdapter

public KernelBinaryCategorizerOnlineLearnerAdapter(Kernel<? super InputType> kernel,
                                                   KernelizableBinaryCategorizerOnlineLearner learner)
Creates a new KernelBinaryCategorizerOnlineLearnerAdapter with the given kernel and learner.

Parameters:
kernel - The kernel to use.
learner - The kernelizable learner 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>>
Overrides:
createInitialLearnedObject in class AbstractOnlineKernelBinaryCategorizerLearner<InputType>
Returns:
The initial learned object.

update

public void update(DefaultKernelBinaryCategorizer<InputType> target,
                   InputOutputPair<? extends InputType,Boolean> data)
Description copied from interface: IncrementalLearner
The update method updates an object of ResultType using the given new data of type DataType, using some form of "learning" algorithm.

Specified by:
update in interface IncrementalLearner<InputOutputPair<? extends InputType,Boolean>,DefaultKernelBinaryCategorizer<InputType>>
Overrides:
update in class AbstractSupervisedBatchAndIncrementalLearner<InputType,Boolean,DefaultKernelBinaryCategorizer<InputType>>
Parameters:
target - The object to update.
data - The new data for the learning algorithm to use to update the 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>>
Overrides:
update in class AbstractOnlineKernelBinaryCategorizerLearner<InputType>
Parameters:
target - The object to update.
input - The supervised input to learn from.
output - The supervised output to learn from.

update

public void update(DefaultKernelBinaryCategorizer<InputType> target,
                   InputType input,
                   boolean output)
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.
output - The output value associated with the input.

getLearner

public KernelizableBinaryCategorizerOnlineLearner getLearner()
Gets the kernelizable learner that this adapter is wrapping.

Returns:
The kernelizable learner that this adapter is wrapping.

setLearner

public void setLearner(KernelizableBinaryCategorizerOnlineLearner learner)
Sets the kernelizable learner that this adapter is wrapping.

Parameters:
learner - The kernelizable learner that this adapter is wrapping.