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

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
All Implemented Interfaces:
BatchAndIncrementalLearner<InputOutputPair<? extends Vectorizable,Boolean>,LinearBinaryCategorizer>, BatchLearner<Collection<? extends InputOutputPair<? extends Vectorizable,Boolean>>,LinearBinaryCategorizer>, IncrementalLearner<InputOutputPair<? extends Vectorizable,Boolean>,LinearBinaryCategorizer>, SupervisedBatchAndIncrementalLearner<Vectorizable,Boolean,LinearBinaryCategorizer>, SupervisedBatchLearner<Vectorizable,Boolean,LinearBinaryCategorizer>, SupervisedIncrementalLearner<Vectorizable,Boolean,LinearBinaryCategorizer>, VectorFactoryContainer, CloneableSerializable, Serializable, Cloneable
Direct Known Subclasses:
AbstractKernelizableBinaryCategorizerOnlineLearner, Winnow

public abstract class AbstractOnlineLinearBinaryCategorizerLearner
extends AbstractSupervisedBatchAndIncrementalLearner<Vectorizable,Boolean,LinearBinaryCategorizer>
implements VectorFactoryContainer

An abstract class for online (incremental) learning algorithms that produce an LinearBinaryCategorizer. It implements common functionality, such as keeping track of the vector factory to use and creating the initial linear binary categorizer object.

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

Field Summary
protected  VectorFactory<?> vectorFactory
          The factory to create weight vectors.
 
Constructor Summary
AbstractOnlineLinearBinaryCategorizerLearner()
          Creates a new AbstractOnlineLinearBinaryCategorizerLearner with the default vector factory.
AbstractOnlineLinearBinaryCategorizerLearner(VectorFactory<?> vectorFactory)
          Creates a new AbstractOnlineLinearBinaryCategorizerLearner with the given vector factory.
 
Method Summary
 LinearBinaryCategorizer createInitialLearnedObject()
          Creates a new initial learned object, before any data is given.
 VectorFactory<?> getVectorFactory()
          Gets the VectorFactory used to create the weight vector.
 void setVectorFactory(VectorFactory<?> vectorFactory)
          Sets the VectorFactory used to create the weight vector.
abstract  void update(LinearBinaryCategorizer target, Vector 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.
 void update(LinearBinaryCategorizer target, Vectorizable 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.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
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Field Detail

vectorFactory

protected VectorFactory<?> vectorFactory
The factory to create weight vectors.

Constructor Detail

AbstractOnlineLinearBinaryCategorizerLearner

public AbstractOnlineLinearBinaryCategorizerLearner()
Creates a new AbstractOnlineLinearBinaryCategorizerLearner with the default vector factory.


AbstractOnlineLinearBinaryCategorizerLearner

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

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

createInitialLearnedObject

public LinearBinaryCategorizer 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 Vectorizable,Boolean>,LinearBinaryCategorizer>
Returns:
The initial learned object.

update

public void update(LinearBinaryCategorizer target,
                   Vectorizable 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<Vectorizable,Boolean,LinearBinaryCategorizer>
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(LinearBinaryCategorizer target,
                            Vector 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.

Parameters:
target - The object to update.
input - The supervised input vector to learn from.
output - The supervised output label to learn from.

getVectorFactory

public VectorFactory<?> getVectorFactory()
Gets the VectorFactory used to create the weight vector.

Specified by:
getVectorFactory in interface VectorFactoryContainer
Returns:
The VectorFactory used to create the weight vector.

setVectorFactory

public void setVectorFactory(VectorFactory<?> vectorFactory)
Sets the VectorFactory used to create the weight vector.

Parameters:
vectorFactory - The VectorFactory used to create the weight vector.