prtClassBagging Bagging (Bootstrap Aggregating) classifier
CLASSIFIER = prtClassBagging returns a bagging classifier
CLASSIFIER = prtClassBagging(PROPERTY1, VALUE1, ...) constructs a
prtClassBagging object CLASSIFIER with properties as specified by
PROPERTY/VALUE pairs.
A prtClassBagging object inherits all properties from the abstract
class prtClass. In addition is has the following properties:
baseClassifier - The base classifier to be used
nBags - The number of bags to aggregate over
nSamplesPerBag - The number of bootstrap samples to use per bag.
When nSamplesPerBag is an empty matrix (the default),
the number of bootstrap samples is set to the number of
observations in the training data set.
bootstrapByClass - A logical describing whether to enforce an
equal number of bootstrap samples from each class in the
training data set. If bootstrapByClass is true,
floor(nSamplesPerBag/nClasses) samples per class are used
when training each classifier. bootstrapByClass defaults
to false.
Bagging classifiers are meta-classifiers that attempt to develop
more robust decision boundaries by aggregating outputs over
multiple bootstrapped samples of the original data. For more
information on bagging classifiers, see:
http://en.wikipedia.org/wiki/Bootstrap_aggregating
A prtClassBagging object inherits the TRAIN, RUN,
CROSSVALIDATE and KFOLDS methods from prtAction. It also inherits
the PLOT method from prtClass.
Example:
TestDataSet = prtDataGenUnimodal; % Create some test and
TrainingDataSet = prtDataGenUniModal; % training data
classifier = prtClassBagging; % Create a classifier
classifier.baseClassifier = prtClassMap; % Set the classifier to
% a prtClassMap
classifier = classifier.train(TrainingDataSet); % Train
classified = run(classifier, TestDataSet); % Test
subplot(2,1,1);
classifier.plot;
subplot(2,1,2);
[pf,pd] = prtScoreRoc(classified,TestDataSet);
h = plot(pf,pd,'linewidth',3);
title('ROC'); xlabel('Pf'); ylabel('Pd');