DefaultYfit property

Class: TreeBagger

Default value returned by predict and oobPredict

Description

The DefaultYfit property controls what predicted value TreeBagger returns when no prediction is possible, for example when the oobPredict method needs to predict for an observation that is in-bag for all trees in the ensemble.

For classification, you can set this property to either '' or 'MostPopular'. If you choose 'MostPopular' (default), the property value becomes the name of the most probable class in the training data.

For regression, you can set this property to any numeric scalar. The default is the mean of the response for the training data.

If you set this property to '' for classification or NaN for regression, TreeBagger excludes the in-bag observations from computation of the out-of-bagerror and margin.

Was this topic helpful?