gov.sandia.cognition.learning.algorithm.perceptron.kernel
Class Projectron.LinearSoftMargin<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>
                      extended by gov.sandia.cognition.learning.algorithm.perceptron.kernel.Projectron.LinearSoftMargin<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
Enclosing class:
Projectron<InputType>

@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",
                      notes="This is the Projectron++.")
public static class Projectron.LinearSoftMargin<InputType>
extends Projectron<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 an extension of the Projectron algorithm inspired by the Passive Aggressive I algorithm (PA-I), which uses a linear soft margin constraint. This is why the class is named LinearSoftMargin, like the PA-I implementation.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class gov.sandia.cognition.learning.algorithm.perceptron.kernel.Projectron
Projectron.LinearSoftMargin<InputType>
 
Field Summary
 
Fields inherited from class gov.sandia.cognition.learning.algorithm.perceptron.kernel.Projectron
DEFAULT_ETA, eta
 
Fields inherited from class gov.sandia.cognition.learning.algorithm.perceptron.kernel.AbstractOnlineKernelBinaryCategorizerLearner
kernel
 
Constructor Summary
Projectron.LinearSoftMargin()
          Creates a new Projectron.LinearSoftMargin with a null kernel and default┬áparameters.
Projectron.LinearSoftMargin(Kernel<? super InputType> kernel)
          Creates a new Projectron.LinearSoftMargin with the given kernel and default parameters.
Projectron.LinearSoftMargin(Kernel<? super InputType> kernel, double eta)
          Creates a new Projectron.LinearSoftMargin 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.
protected  boolean shouldUpdate(double margin)
          Determine if an update should be made.
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.perceptron.kernel.Projectron
getEta, setEta, update
 
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
 

Constructor Detail

Projectron.LinearSoftMargin

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


Projectron.LinearSoftMargin

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

Parameters:
kernel - The kernel to use.

Projectron.LinearSoftMargin

public Projectron.LinearSoftMargin(Kernel<? super InputType> kernel,
                                   double eta)
Creates a new Projectron.LinearSoftMargin 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

shouldUpdate

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

Overrides:
shouldUpdate in class Projectron<InputType>
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)
Description copied from class: Projectron
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.

Overrides:
applyUpdate in class Projectron<InputType>
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.