crossval
Class: RegressionTree
Cross-validated decision tree
Syntax
cvmodel = crossval(model)
cvmodel = crossval(model,Name,Value)
Description
creates a partitioned model from cvmodel
= crossval(model
)model
, a fitted regression tree. By
default, crossval
uses 10-fold cross validation on the
training data to create cvmodel
.
creates a partitioned model with additional options specified by one or more
cvmodel
= crossval(model
,Name,Value
)Name,Value
pair arguments.
Input Arguments
|
A regression model, produced using |
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
|
Object of class Use only one of these four options at a time:
Default: |
|
Holdout validation tests the specified fraction of the data, and uses
the rest of the data for training. Specify a numeric scalar from
|
|
Number of folds to use in a cross-validated tree, a positive integer value greater than 1. Use only one of these four options at a time:
Default: 10 |
|
Set to |
Output Arguments
|
A partitioned model of class |
Examples
Tips
Alternatives
You can create a cross-validation tree directly from the data, instead of creating a
decision tree followed by a cross-validation tree. To do so, include one of these five
options in fitrtree
: 'CrossVal'
,
'KFold'
, 'Holdout'
,
'Leaveout'
, or 'CVPartition'
.