compact

Class: RegressionEnsemble

Create compact regression ensemble

Syntax

cens = compact(ens)

Description

cens = compact(ens) creates a compact version of ens. You can predict regressions 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

ens

A regression ensemble created with fitensemble.

Output Arguments

cens

A compact regression ensemble. cens is of class CompactRegressionEnsemble.

Examples

Compare the size of a regression ensemble for the carsmall data to the compact version of the ensemble:

load carsmall
X = [Acceleration Cylinders Displacement Horsepower Weight];
ens = fitensemble(X,MPG,'LSBoost',100,'Tree');
cens = compact(ens);
b = whos('ens'); % b.bytes = size of ens
c = whos('cens'); % c.bytes = size of cens
[b.bytes c.bytes] % shows ctree uses less memory

ans =
      311789      287368
Was this topic helpful?