gov.sandia.cognition.learning.algorithm.perceptron.kernel
Class Projectron<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.Projectron<InputType>
Type Parameters:
InputType - The type of input to learn over. 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
Direct Known Subclasses:
Projectron.LinearSoftMargin

@PublicationReference(author={"Francesco Orabona","Joseph Keshet","Barbara Caputo"},
                      title="Bounded Kernel-Based Online Learning",
                      year=2009,
                      type=Journal,
                      publication="Journal of Machine Learning Research",
                      pages={2643,2666},
                      url="http://portal.acm.org/citation.cfm?id=1755875")
public class Projectron<InputType>
extends AbstractOnlineKernelBinaryCategorizerLearner<InputType>

An implementation of the Projectron algorithm, which is an online kernel binary categorizer learner that has a budget parameter tuned by the eta parameter. It is based on the Perceptron algorithm with the addition that it attempts to project errors onto the existing set of supports and adjusting their weights instead of always adding them.

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

Nested Class Summary
static class Projectron.LinearSoftMargin<InputType>
          An implementation of the Projectron++ algorithm, which is an online kernel binary categorizer learner that has a budget parameter tuned by the eta parameter.
 
Field Summary
static double DEFAULT_ETA
          The default value of eta is 0.01.
protected  double eta
          The eta parameter, which ends up controlling the number of supports created.
 
Fields inherited from class gov.sandia.cognition.learning.algorithm.perceptron.kernel.AbstractOnlineKernelBinaryCategorizerLearner
kernel
 
Constructor Summary
Projectron()
          Creates a new Projectron with a null kernel and default parameters.
Projectron(Kernel<? super InputType> kernel)
          Creates a new Projectron with the given kernel and default parameters.
Projectron(Kernel<? super InputType> kernel, double eta)
          Creates a new Projectron with the given parameters.
 
Method Summary
protected  void applyUpdate(DefaultKernelBinaryCategorizer<InputType> target, InputType input, double actual, double margin, double kernelInputInput, double delta, Vector d)
          Apply the update for the Projectron.
 double getEta()
          Gets the eta parameter that controls how many supports are allowed.
 void setEta(double eta)
          Sets the eta parameter that controls how many supports are allowed.
protected  boolean shouldUpdate(double margin)
          Determine if an update should be made.
 void update(DefaultKernelBinaryCategorizer<InputType> target, InputType input, boolean label)
          Updates the target categorizer based on the given input and its associated output.
 
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

DEFAULT_ETA

public static final double DEFAULT_ETA
The default value of eta is 0.01.

See Also:
Constant Field Values

eta

protected double eta
The eta parameter, which ends up controlling the number of supports created. Must be non-negative.

Constructor Detail

Projectron

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


Projectron

public Projectron(Kernel<? super InputType> kernel)
Creates a new Projectron with the given kernel and default parameters.

Parameters:
kernel - The kernel to use.

Projectron

public Projectron(Kernel<? super InputType> kernel,
                  double eta)
Creates a new Projectron with the given parameters.

Parameters:
kernel - The kernel to use.
eta - The eta parameter, which controls the number of supports created. Must be non-negative.
Method Detail

update

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

shouldUpdate

protected boolean shouldUpdate(double margin)
Determine if an update should be made. This is here so that the Projectron++ implementation can override it to provide a margin update.

Parameters:
margin - The margin.
Returns:
A determination of whether or not an update should be made based on the margin.

applyUpdate

protected void applyUpdate(DefaultKernelBinaryCategorizer<InputType> target,
                           InputType input,
                           double actual,
                           double margin,
                           double kernelInputInput,
                           double delta,
                           Vector d)
Apply the update for the Projectron. This function is put here so that it can be overriden by the Projectron++ implementation, which also enforces a margin.

Parameters:
target - The target to update.
input - The input value.
actual - The actual label.
margin - The margin on the input.
kernelInputInput - The kernel function k(input, input).
delta - The value delta computed by the Projectron.
d - The vector d that represents the coefficients for the projection.

getEta

public double getEta()
Gets the eta parameter that controls how many supports are allowed.

Returns:
The eta parameter. Cannot be negative.

setEta

public void setEta(double eta)
Sets the eta parameter that controls how many supports are allowed.

Parameters:
eta - The eta parameter. Cannot be negative.