InputType
- The input type for supervised learning. Passed on to the internal
learning algorithm. Also the input type for the learned ensemble.CategoryType
- The output type for supervised learning. Passed on to the internal
learning algorithm. Also the output type of the learned ensemble.MemberType
- The type of ensemble member created by the base algorithm.@PublicationReference(author={"Nikunj C. Oza","Stuart Russell"}, title="Online Bagging and Boosting", year=2001, type=Conference, publication="In Artificial Intelligence and Statistics", pages={105,112}, url="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.32.8889") public class OnlineBaggingCategorizerLearner<InputType,CategoryType,MemberType extends Evaluator<? super InputType,? extends CategoryType>> extends AbstractSupervisedBatchAndIncrementalLearner<InputType,CategoryType,VotingCategorizerEnsemble<InputType,CategoryType,MemberType>> implements Randomized
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_ENSEMBLE_SIZE
The default ensemble size is 100.
|
static double |
DEFAULT_PERCENT_TO_SAMPLE
The default percent to sample is 1.0 (which represents 100%).
|
protected int |
ensembleSize
The size of the ensemble to create.
|
protected IncrementalLearner<? super InputOutputPair<? extends InputType,CategoryType>,MemberType> |
learner
The base learner used for each ensemble member.
|
protected double |
percentToSample
The percentage of the data to sample for each ensemble member.
|
protected java.util.Random |
random
The random number generator to use.
|
Constructor and Description |
---|
OnlineBaggingCategorizerLearner()
Creates a new
OnlineBaggingCategorizerLearner with a null learner
and default parameters. |
OnlineBaggingCategorizerLearner(IncrementalLearner<? super InputOutputPair<? extends InputType,CategoryType>,MemberType> learner)
Creates a new
OnlineBaggingCategorizerLearner with the given
base learner and default parameters. |
OnlineBaggingCategorizerLearner(IncrementalLearner<? super InputOutputPair<? extends InputType,CategoryType>,MemberType> learner,
int ensembleSize,
double percentToSample,
java.util.Random random)
Creates a new
OnlineBaggingCategorizerLearner with the given
parameters. |
Modifier and Type | Method and Description |
---|---|
static <InputType,CategoryType,MemberType extends Evaluator<? super InputType,? extends CategoryType>> |
create(IncrementalLearner<? super InputOutputPair<? extends InputType,CategoryType>,MemberType> learner,
int ensembleSize,
double percentToSample,
java.util.Random random)
Convenience method for creating an
OnlineBaggingCategorizerLearner . |
VotingCategorizerEnsemble<InputType,CategoryType,MemberType> |
createInitialLearnedObject()
Creates a new initial learned object, before any data is given.
|
int |
getEnsembleSize()
Gets the size of the ensemble to create.
|
IncrementalLearner<? super InputOutputPair<? extends InputType,CategoryType>,MemberType> |
getLearner()
Gets the incremental (online) learning algorithm to use to learn all of
the ensemble members.
|
double |
getPercentToSample()
Gets the percent of the data to attempt to sample for each ensemble
member.
|
java.util.Random |
getRandom()
Gets the random number generator used by this object.
|
void |
setEnsembleSize(int ensembleSize)
Sets the size of the ensemble to create.
|
void |
setLearner(IncrementalLearner<? super InputOutputPair<? extends InputType,CategoryType>,MemberType> learner)
Sets the incremental (online) learning algorithm to use to learn all of
the ensemble members.
|
void |
setPercentToSample(double percentToSample)
Sets the percent of the data to attempt to sample for each ensemble
member.
|
void |
setRandom(java.util.Random random)
Sets the random number generator used by this object.
|
void |
update(VotingCategorizerEnsemble<InputType,CategoryType,MemberType> target,
InputOutputPair<? extends InputType,CategoryType> data)
The
update method updates an object of ResultType using
the given new data of type DataType , using some form of
"learning" algorithm. |
void |
update(VotingCategorizerEnsemble<InputType,CategoryType,MemberType> target,
InputType input,
CategoryType category)
The
update method updates an object of ResultType using
the given a new supervised input-output pair, using some form of
"learning" algorithm. |
clone, learn, learn, update
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
learn
learn
update
clone
public static final int DEFAULT_ENSEMBLE_SIZE
public static final double DEFAULT_PERCENT_TO_SAMPLE
protected IncrementalLearner<? super InputOutputPair<? extends InputType,CategoryType>,MemberType extends Evaluator<? super InputType,? extends CategoryType>> learner
protected int ensembleSize
protected double percentToSample
protected java.util.Random random
public OnlineBaggingCategorizerLearner()
OnlineBaggingCategorizerLearner
with a null learner
and default parameters.public OnlineBaggingCategorizerLearner(IncrementalLearner<? super InputOutputPair<? extends InputType,CategoryType>,MemberType> learner)
OnlineBaggingCategorizerLearner
with the given
base learner and default parameters.learner
- The base learner to use for each ensemble member.public OnlineBaggingCategorizerLearner(IncrementalLearner<? super InputOutputPair<? extends InputType,CategoryType>,MemberType> learner, int ensembleSize, double percentToSample, java.util.Random random)
OnlineBaggingCategorizerLearner
with the given
parameters.learner
- The base learner to use for each ensemble member.ensembleSize
- The size of the ensemble to create. Must be positive,percentToSample
- The percentage of the data to sample for learning each ensemble
member. Must be positive.random
- The random number generator to use.public VotingCategorizerEnsemble<InputType,CategoryType,MemberType> createInitialLearnedObject()
IncrementalLearner
createInitialLearnedObject
in interface IncrementalLearner<InputOutputPair<? extends InputType,CategoryType>,VotingCategorizerEnsemble<InputType,CategoryType,MemberType extends Evaluator<? super InputType,? extends CategoryType>>>
public void update(VotingCategorizerEnsemble<InputType,CategoryType,MemberType> target, InputType input, CategoryType category)
SupervisedIncrementalLearner
update
method updates an object of ResultType
using
the given a new supervised input-output pair, using some form of
"learning" algorithm.update
in interface SupervisedIncrementalLearner<InputType,CategoryType,VotingCategorizerEnsemble<InputType,CategoryType,MemberType extends Evaluator<? super InputType,? extends CategoryType>>>
target
- The object to update.input
- The supervised input to learn from.category
- The supervised output to learn from.public void update(VotingCategorizerEnsemble<InputType,CategoryType,MemberType> target, InputOutputPair<? extends InputType,CategoryType> data)
IncrementalLearner
update
method updates an object of ResultType
using
the given new data of type DataType
, using some form of
"learning" algorithm.update
in interface IncrementalLearner<InputOutputPair<? extends InputType,CategoryType>,VotingCategorizerEnsemble<InputType,CategoryType,MemberType extends Evaluator<? super InputType,? extends CategoryType>>>
update
in class AbstractSupervisedBatchAndIncrementalLearner<InputType,CategoryType,VotingCategorizerEnsemble<InputType,CategoryType,MemberType extends Evaluator<? super InputType,? extends CategoryType>>>
target
- The object to update.data
- The new data for the learning algorithm to use to update
the object.public IncrementalLearner<? super InputOutputPair<? extends InputType,CategoryType>,MemberType> getLearner()
public void setLearner(IncrementalLearner<? super InputOutputPair<? extends InputType,CategoryType>,MemberType> learner)
learner
- The base learning algorithm.public int getEnsembleSize()
public void setEnsembleSize(int ensembleSize)
ensembleSize
- The size of the ensemble to create. Must be positive.public double getPercentToSample()
public void setPercentToSample(double percentToSample)
percentToSample
- The percentage of the data to sample for each ensemble member.
Must be positive.public java.util.Random getRandom()
Randomized
getRandom
in interface Randomized
public void setRandom(java.util.Random random)
Randomized
setRandom
in interface Randomized
random
- The random number generator for this object to use.public static <InputType,CategoryType,MemberType extends Evaluator<? super InputType,? extends CategoryType>> OnlineBaggingCategorizerLearner<InputType,CategoryType,MemberType> create(IncrementalLearner<? super InputOutputPair<? extends InputType,CategoryType>,MemberType> learner, int ensembleSize, double percentToSample, java.util.Random random)
OnlineBaggingCategorizerLearner
.InputType
- The input type for supervised learning. Passed on to the internal
learning algorithm. Also the input type for the learned ensemble.CategoryType
- The output type for supervised learning. Passed on to the internal
learning algorithm. Also the output type of the learned ensemble.MemberType
- The type of ensemble member created by the base algorithm.learner
- The base learner to use for each ensemble member.ensembleSize
- The size of the ensemble to create. Must be positive,percentToSample
- The percentage of the data to sample for learning each ensemble
member. Must be positive.random
- The random number generator to use.