gov.sandia.cognition.learning.algorithm.ensemble
Class BinaryCategorizerSelector<InputType>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.algorithm.ensemble.BinaryCategorizerSelector<InputType>
Type Parameters:
InputType - The type of the input.
All Implemented Interfaces:
BatchLearner<Collection<? extends InputOutputPair<? extends InputType,Boolean>>,BinaryCategorizer<? super InputType>>, SupervisedBatchLearner<InputType,Boolean,BinaryCategorizer<? super InputType>>, CloneableSerializable, Serializable, Cloneable

@CodeReview(reviewer="Kevin R. Dixon",
            date="2008-07-23",
            changesNeeded=false,
            comments={"Removed implements Serializable, since BatchLearner already does.","Otherwise, looks fine."})
public class BinaryCategorizerSelector<InputType>
extends AbstractCloneableSerializable
implements SupervisedBatchLearner<InputType,Boolean,BinaryCategorizer<? super InputType>>

The BinaryCategorizerSelector class implements a "weak learner" meant for use in boosting algorithms that selects the best BinaryCategorizer from a pre-set list by picking the one with the best weighted error.

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

Field Summary
protected  Collection<BinaryCategorizer<? super InputType>> categorizers
          The collection of categorizers to evaluate and select from.
 
Constructor Summary
BinaryCategorizerSelector()
          Creates a new instance of BinaryCategorizerSelector.
BinaryCategorizerSelector(Collection<BinaryCategorizer<? super InputType>> categorizers)
          Creates a new instance of BinaryCategorizerSelector.
 
Method Summary
 Collection<BinaryCategorizer<? super InputType>> getCategorizers()
          Gets the collection of categorizers that the learner selects from.
 BinaryCategorizer<? super InputType> learn(Collection<? extends InputOutputPair<? extends InputType,Boolean>> data)
          Selects the BinaryCategorizer from its list of categorizers that minimizes the weighted error on the given set of weighted input-output pairs.
 void setCategorizers(Collection<BinaryCategorizer<? super InputType>> categorizers)
          Gets the collection of categorizers that the learner selects from.
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
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
 

Field Detail

categorizers

protected Collection<BinaryCategorizer<? super InputType>> categorizers
The collection of categorizers to evaluate and select from.

Constructor Detail

BinaryCategorizerSelector

public BinaryCategorizerSelector()
Creates a new instance of BinaryCategorizerSelector.


BinaryCategorizerSelector

public BinaryCategorizerSelector(Collection<BinaryCategorizer<? super InputType>> categorizers)
Creates a new instance of BinaryCategorizerSelector.

Parameters:
categorizers - The categorizers to use.
Method Detail

learn

public BinaryCategorizer<? super InputType> learn(Collection<? extends InputOutputPair<? extends InputType,Boolean>> data)
Selects the BinaryCategorizer from its list of categorizers that minimizes the weighted error on the given set of weighted input-output pairs.

Specified by:
learn in interface BatchLearner<Collection<? extends InputOutputPair<? extends InputType,Boolean>>,BinaryCategorizer<? super InputType>>
Parameters:
data - The set of weighted input-output pairs to use to select the best categorizer.
Returns:
The BinaryCategorizer from its list of categorizers that minimizes the weighted error on the given data.

getCategorizers

public Collection<BinaryCategorizer<? super InputType>> getCategorizers()
Gets the collection of categorizers that the learner selects from.

Returns:
The collection of categorizers that the learner selects from.

setCategorizers

public void setCategorizers(Collection<BinaryCategorizer<? super InputType>> categorizers)
Gets the collection of categorizers that the learner selects from.

Parameters:
categorizers - The collection of categorizers that the learner selects from.