InputType - The type of input that the weak learner can learn over.CategoryType - The type of categories to learn over.@PublicationReference(author={"Yoav Freund","Robert E.Schapire"}, title="A decision-theoretic generalization of on-line learning and an application to boosting", publication="Journal of Computer and System Sciences", notes="Volume 55, Number 1", year=1997, pages={119,139}, type=Journal, url="http://www.cse.ucsd.edu/~yfreund/papers/adaboost.pdf") public class MultiCategoryAdaBoost<InputType,CategoryType> extends AbstractAnytimeSupervisedBatchLearner<InputType,CategoryType,WeightedVotingCategorizerEnsemble<InputType,CategoryType,Evaluator<? super InputType,? extends CategoryType>>> implements BatchLearnerContainer<BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,? extends Evaluator<? super InputType,? extends CategoryType>>>
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_ITERATIONS
The default maximum number of iterations is 100.
|
protected WeightedVotingCategorizerEnsemble<InputType,CategoryType,Evaluator<? super InputType,? extends CategoryType>> |
ensemble
The ensemble learned by the algorithm.
|
protected BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,? extends Evaluator<? super InputType,? extends CategoryType>> |
weakLearner
The "weak learner" that must learn from the weighted input-output pairs
on each iteration.
|
protected java.util.ArrayList<DefaultWeightedInputOutputPair<InputType,CategoryType>> |
weightedData
An array list containing the weighted version of the data.
|
data, keepGoingmaxIterationsDEFAULT_ITERATION, iteration| Constructor and Description |
|---|
MultiCategoryAdaBoost()
Creates a new
MultiCategoryAdaBoost with default parameters and a null
weak learner. |
MultiCategoryAdaBoost(BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,? extends Evaluator<? super InputType,? extends CategoryType>> weakLearner,
int maxIterations)
Creates a new
MultiCategoryAdaBoost with the given parameters. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanupAlgorithm()
Called to clean up the learning algorithm's state after learning has
finished.
|
BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,? extends Evaluator<? super InputType,? extends CategoryType>> |
getLearner()
Gets the learner contained in this object.
|
WeightedVotingCategorizerEnsemble<InputType,CategoryType,Evaluator<? super InputType,? extends CategoryType>> |
getResult()
Gets the current result of the algorithm.
|
BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,? extends Evaluator<? super InputType,? extends CategoryType>> |
getWeakLearner()
Gets the weak learner that is passed the weighted training data on each
step of the algorithm.
|
protected boolean |
initializeAlgorithm()
Called to initialize the learning algorithm's state based on the
data that is stored in the data field.
|
void |
setWeakLearner(BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,? extends Evaluator<? super InputType,? extends CategoryType>> weakLearner)
Sets the weak learner that is passed the weighted training data on each
step of the algorithm.
|
protected boolean |
step()
Called to take a single step of the learning algorithm.
|
clone, getData, getKeepGoing, learn, setData, setKeepGoing, stopgetMaxIterations, isResultValid, setMaxIterationsaddIterativeAlgorithmListener, fireAlgorithmEnded, fireAlgorithmStarted, fireStepEnded, fireStepStarted, getIteration, getListeners, removeIterativeAlgorithmListener, setIteration, setListenersequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitlearnclonegetMaxIterations, setMaxIterationsaddIterativeAlgorithmListener, getIteration, removeIterativeAlgorithmListenerisResultValidpublic static final int DEFAULT_MAX_ITERATIONS
protected BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,? extends Evaluator<? super InputType,? extends CategoryType>> weakLearner
protected transient WeightedVotingCategorizerEnsemble<InputType,CategoryType,Evaluator<? super InputType,? extends CategoryType>> ensemble
protected transient java.util.ArrayList<DefaultWeightedInputOutputPair<InputType,CategoryType>> weightedData
public MultiCategoryAdaBoost()
MultiCategoryAdaBoost with default parameters and a null
weak learner.public MultiCategoryAdaBoost(BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,? extends Evaluator<? super InputType,? extends CategoryType>> weakLearner, int maxIterations)
MultiCategoryAdaBoost with the given parameters.weakLearner - The weak learner to use.maxIterations - The maximum number of iterations. Must be positive.protected boolean initializeAlgorithm()
AbstractAnytimeBatchLearnerinitializeAlgorithm in class AbstractAnytimeBatchLearner<java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,WeightedVotingCategorizerEnsemble<InputType,CategoryType,Evaluator<? super InputType,? extends CategoryType>>>protected boolean step()
AbstractAnytimeBatchLearnerstep in class AbstractAnytimeBatchLearner<java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,WeightedVotingCategorizerEnsemble<InputType,CategoryType,Evaluator<? super InputType,? extends CategoryType>>>protected void cleanupAlgorithm()
AbstractAnytimeBatchLearnercleanupAlgorithm in class AbstractAnytimeBatchLearner<java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,WeightedVotingCategorizerEnsemble<InputType,CategoryType,Evaluator<? super InputType,? extends CategoryType>>>public WeightedVotingCategorizerEnsemble<InputType,CategoryType,Evaluator<? super InputType,? extends CategoryType>> getResult()
AnytimeAlgorithmgetResult in interface AnytimeAlgorithm<WeightedVotingCategorizerEnsemble<InputType,CategoryType,Evaluator<? super InputType,? extends CategoryType>>>public BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,? extends Evaluator<? super InputType,? extends CategoryType>> getLearner()
BatchLearnerContainergetLearner in interface BatchLearnerContainer<BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,? extends Evaluator<? super InputType,? extends CategoryType>>>public BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,? extends Evaluator<? super InputType,? extends CategoryType>> getWeakLearner()
public void setWeakLearner(BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,CategoryType>>,? extends Evaluator<? super InputType,? extends CategoryType>> weakLearner)
weakLearner - The weak learner for the algorithm to use.