gov.sandia.cognition.learning.algorithm.perceptron.kernel
Class OnlineKernelRandomizedBudgetPerceptron<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.AbstractOnlineBudgetedKernelBinaryCategorizerLearner<InputType>
                      extended by gov.sandia.cognition.learning.algorithm.perceptron.kernel.OnlineKernelRandomizedBudgetPerceptron<InputType>
Type Parameters:
InputType - The type of the input to the algorithm, which is passed to the kernel function for use in learning.
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, Randomized, Serializable, Cloneable

@PublicationReference(author={"Nicolo Cesa-Bianchi","Claudio Gentile"},
                      title="Tracking the Best Hyperplane with a Simple Budget Perceptron",
                      year=2006,
                      type=Conference,
                      publication="Conference on Learning Theory",
                      pages={483,498},
                      url="http://www.springerlink.com/index/d65th427143p0532.pdf")
public class OnlineKernelRandomizedBudgetPerceptron<InputType>
extends AbstractOnlineBudgetedKernelBinaryCategorizerLearner<InputType>
implements Randomized

An implementation of a fixed-memory kernel Perceptron algorithm. It randomly removes an item when it needs to make an update and its budget is exceeded.

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

Field Summary
protected  Random random
          The random number generator.
 
Fields inherited from class gov.sandia.cognition.learning.algorithm.perceptron.kernel.AbstractOnlineBudgetedKernelBinaryCategorizerLearner
budget, DEFAULT_BUDGET
 
Fields inherited from class gov.sandia.cognition.learning.algorithm.perceptron.kernel.AbstractOnlineKernelBinaryCategorizerLearner
kernel
 
Constructor Summary
OnlineKernelRandomizedBudgetPerceptron()
          Creates a new OnlineKernelRandomizedBudgetPerceptron with default parameters and a null kernel.
OnlineKernelRandomizedBudgetPerceptron(Kernel<? super InputType> kernel, int budget, Random random)
          Creates a new OnlineKernelRandomizedBudgetPerceptron with the given parameters.
 
Method Summary
 Random getRandom()
          Gets the random number generator used by this object.
 void setRandom(Random random)
          Sets the random number generator used by this object.
 void update(DefaultKernelBinaryCategorizer<InputType> target, InputType input, boolean output)
          Updates the target categorizer based on the given input and its associated output.
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.perceptron.kernel.AbstractOnlineBudgetedKernelBinaryCategorizerLearner
getBudget, setBudget
 
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
 

Field Detail

random

protected Random random
The random number generator.

Constructor Detail

OnlineKernelRandomizedBudgetPerceptron

public OnlineKernelRandomizedBudgetPerceptron()
Creates a new OnlineKernelRandomizedBudgetPerceptron with default parameters and a null kernel.


OnlineKernelRandomizedBudgetPerceptron

public OnlineKernelRandomizedBudgetPerceptron(Kernel<? super InputType> kernel,
                                              int budget,
                                              Random random)
Creates a new OnlineKernelRandomizedBudgetPerceptron with the given parameters.

Parameters:
kernel - The kernel function to use.
budget - The budget for the algorithm. Must be positive.
random - The random number generator.
Method Detail

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.

getRandom

public Random getRandom()
Description copied from interface: Randomized
Gets the random number generator used by this object.

Specified by:
getRandom in interface Randomized
Returns:
The random number generator used by this object.

setRandom

public void setRandom(Random random)
Description copied from interface: Randomized
Sets the random number generator used by this object.

Specified by:
setRandom in interface Randomized
Parameters:
random - The random number generator for this object to use.