Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

removeLearners

Class: CompactClassificationEnsemble

Remove members of compact classification ensemble

Syntax

cens1 = removeLearners(cens,idx)

Description

cens1 = removeLearners(cens,idx) creates a compact classification ensemble identical to cens only without the ensemble members in the idx vector.

Input Arguments

cens

Compact classification ensemble, constructed with compact.

idx

Vector of positive integers with entries from 1 to cens.NumTrained, where cens.NumTrained is the number of members in cens. cens1 contains all members of cens except those with indices in idx.

Typically, you set idx = j:cens.NumTrained for some positive integer j.

Output Arguments

cens1

Compact classification ensemble, identical to cens except cens1 does not contain those members of cens with indices in idx.

Examples

expand all

Create a compact classification ensemble. Compact it further by removing members of the ensemble.

Create a compact classification ensemble for the ionosphere data.

load ionosphere
ens = fitensemble(X,Y,'AdaBoostM1',100,'Tree');
cens = compact(ens);

Remove the last 50 members of the ensemble.

idx = cens.NumTrained-49:cens.NumTrained;
cens1 = removeLearners(cens,idx);

Tips

  • Typically, set cens1 equal to cens to retain just one ensemble.

  • Removing learners reduces the memory used by the ensemble and speeds up its predictions.

Was this topic helpful?