InputType
- The type of the input.@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,java.lang.Boolean,BinaryCategorizer<? super InputType>>
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.Modifier and Type | Field and Description |
---|---|
protected java.util.Collection<BinaryCategorizer<? super InputType>> |
categorizers
The collection of categorizers to evaluate and select from.
|
Constructor and Description |
---|
BinaryCategorizerSelector()
Creates a new instance of
BinaryCategorizerSelector . |
BinaryCategorizerSelector(java.util.Collection<BinaryCategorizer<? super InputType>> categorizers)
Creates a new instance of
BinaryCategorizerSelector . |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<BinaryCategorizer<? super InputType>> |
getCategorizers()
Gets the collection of categorizers that the learner selects from.
|
BinaryCategorizer<? super InputType> |
learn(java.util.Collection<? extends InputOutputPair<? extends InputType,java.lang.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(java.util.Collection<BinaryCategorizer<? super InputType>> categorizers)
Gets the collection of categorizers that the learner selects from.
|
clone
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone
protected java.util.Collection<BinaryCategorizer<? super InputType>> categorizers
public BinaryCategorizerSelector()
BinaryCategorizerSelector
.public BinaryCategorizerSelector(java.util.Collection<BinaryCategorizer<? super InputType>> categorizers)
BinaryCategorizerSelector
.categorizers
- The categorizers to use.public BinaryCategorizer<? super InputType> learn(java.util.Collection<? extends InputOutputPair<? extends InputType,java.lang.Boolean>> data)
learn
in interface BatchLearner<java.util.Collection<? extends InputOutputPair<? extends InputType,java.lang.Boolean>>,BinaryCategorizer<? super InputType>>
data
- The set of weighted input-output pairs to use to select the best
categorizer.public java.util.Collection<BinaryCategorizer<? super InputType>> getCategorizers()
public void setCategorizers(java.util.Collection<BinaryCategorizer<? super InputType>> categorizers)
categorizers
- The collection of categorizers that the learner selects from.