FUNCTION REFERENCE

RegressionPartitionedModel

Cross-validated regression model returned by crossval.

Cross-validated regression model returned by crossval.

Syntax

cvmdl = crossval(mdl, 'KFold', k)

Holds per-fold trained regression models and test-fold indices. Fit the model first, then pass it to crossval with a k-fold or holdout partition. Evaluate out-of-fold predictions and MSE with kfoldPredict and kfoldLoss.

Example

mdl = fitrtree([1; 2; 3; 4; 5; 6], [1; 2; 3; 4; 5; 6]); cv = crossval(mdl, 'KFold', 3); class(cv)   % 'RegressionPartitionedModel'

Differences from MATLAB: fitrtree does not accept the inline 'CrossVal', 'on' option.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.