Documentation Center

  • Trial Software
  • Product Updates

RegressionTree.template

Class: RegressionTree

Create regression template (to be removed)

RegressionTree.template will be removed in a future release. Use templateTree instead.

Syntax

t = RegressionTree.template
t = RegressionTree.template(Name,Value)

Description

t = RegressionTree.template returns a learner template suitable to use in the fitensemble function.

t = RegressionTree.template(Name,Value) creates a template with additional options specified by one or more Name,Value pair arguments. You can specify several name-value pair arguments in any order as Name1,Value1,…,NameN,ValueN.

Input Arguments

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

'MergeLeaves'

String that specifies whether to merge leaves after the tree is grown. Values are 'on' or 'off'.

When 'on', RegressionTree merges leaves that originate from the same parent node, and that give a sum of risk values greater or equal to the risk associated with the parent node. When 'off', RegressionTree does not merge leaves.

Default: 'off'

'MinLeaf'

Each leaf has at least MinLeaf observations per tree leaf. If you supply both MinParent and MinLeaf, RegressionTree uses the setting that gives larger leaves: MinParent=max(MinParent,2*MinLeaf).

Default: Half the number of training observations for boosting, 5 for bagging

'MinParent'

Each branch node in the tree has at least MinParent observations. If you supply both MinParent and MinLeaf, RegressionTree uses the setting that gives larger leaves: MinParent=max(MinParent,2*MinLeaf).

Default: Number of training observations for boosting, 10 for bagging

'NVarToSample'

Number of predictors to select at random for each split. Can be a positive integer or 'all', which means use all available predictors.

Default: 'all' for boosting, one third of the number of predictors for bagging

'Prune'

When 'on', RegressionTree grows the regression tree and computes the optimal sequence of pruned subtrees. When 'off' RegressionTree grows the tree without pruning.

Default: 'off'

'Surrogate'

String describing whether to find surrogate decision splits at each branch node. Specify as 'on', 'off', 'all', or a positive scalar value.

  • When 'on', RegressionTree finds at most 10 surrogate splits at each branch node.

  • When set to a positive integer value, RegressionTree finds at most the specified number of surrogate splits at each branch node.

  • When set to 'all', RegressionTree finds all surrogate splits at each branch node. The 'all' setting can use much time and memory.

Use surrogate splits to improve the accuracy of predictions for data with missing values. The setting also enables you to compute measures of predictive association between predictors.

Default: 'off'

Output Arguments

t

Regression tree template suitable to use in the fitensemble function. In an ensemble, t specifies how to grow the regression trees.

Examples

Create a regression template with surrogate splits, and train an ensemble for the carsmall data with the template:

t = RegressionTree.template('surrogate','on');
load carsmall
X = [Acceleration Displacement Horsepower Weight];
ens = fitensemble(X,MPG,'LSBoost',100,t);

See Also

| |

Was this topic helpful?