This is machine translation

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


Class: ClassificationEnsemble

Compact classification ensemble


cens = compact(ens)


cens = compact(ens) creates a compact version of ens. You can predict classifications using cens exactly as you can using ens. However, since cens does not contain training data, you cannot perform some actions, such as cross validation.

Input Arguments


A classification ensemble created with fitensemble.

Output Arguments


A compact classification ensemble. cens has class CompactClassificationEnsemble.


Compare the size of a classification ensemble for Fisher's iris data to the compact version of the ensemble:

load fisheriris
ens = fitensemble(meas,species,'AdaBoostM2',100,'Tree');
cens = compact(ens);
b = whos('ens'); % b.bytes = size of ens
c = whos('cens'); % c.bytes = size of ens
[b.bytes c.bytes] % shows cens uses less memory

ans =
      571727      532476
Was this topic helpful?