# resubLoss

**Class: **RegressionTree

Regression error by resubstitution

## Syntax

`L = resubLoss(tree)`

L = resubLoss(tree,Name,Value)

L = resubLoss(tree,'Subtrees',subtreevector)

[L,se] =
resubLoss(tree,'Subtrees',subtreevector)

[L,se,NLeaf]
= resubLoss(tree,'Subtrees',subtreevector)

[L,se,NLeaf,bestlevel]
= resubLoss(tree,'Subtrees',subtreevector)

[L,...] = resubLoss(tree,'Subtrees',subtreevector,Name,Value)

## Description

returns
the resubstitution loss, meaning the loss computed for the data that `L`

= resubLoss(`tree`

)`fitrtree`

used to create `tree`

.

returns the loss with additional options specified by one or more
`L`

= resubLoss(`tree`

,`Name,Value`

)`Name,Value`

pair arguments. You can specify several name-value pair
arguments in any order as `Name1,Value1,…,NameN,ValueN`

.

returns a vector of mean squared errors for the trees in the pruning sequence
`L`

= resubLoss(`tree`

,`'Subtrees'`

,subtreevector)`subtreevector`

.

`[`

returns the vector of standard errors of the classification errors.`L`

,`se`

] =
resubLoss(`tree`

,`'Subtrees'`

,subtreevector)

`[`

returns the vector of numbers of leaf nodes in the trees of the pruning sequence.`L`

,`se`

,`NLeaf`

]
= resubLoss(`tree`

,`'Subtrees'`

,subtreevector)

`[`

returns the best pruning level as defined in the `L`

,`se`

,`NLeaf`

,`bestlevel`

]
= resubLoss(`tree`

,`'Subtrees'`

,subtreevector)`TreeSize`

name-value pair.
By default, `bestlevel`

is the pruning level that gives loss within one
standard deviation of minimal loss.

`[L,...] = resubLoss(`

returns loss statistics with additional options specified by one or more
`tree`

,`'Subtrees'`

,subtreevector,`Name,Value`

)`Name,Value`

pair arguments. You can specify several name-value pair
arguments in any order as `Name1,Value1,…,NameN,ValueN`

.

## Input Arguments

## Output Arguments

## Examples

## More About

## Extended Capabilities

## See Also

`resubPredict`

| `loss`

| `fitrtree`