RegressionTree class
Superclasses:CompactRegressionTree
Regression tree
Description
A decision tree with binary splits for regression. An object of classRegressionTree
can predict responses for new data with thepredict
method. The object contains the data used for training, so can compute resubstitution predictions.
Construction
Create aRegressionTree
object by usingfitrtree
.
Properties
|
Bin edges for numeric predictors, specified as a cell array ofpnumeric vectors, wherepis the number of predictors. Each vector includes the bin edges for a numeric predictor. The element in the cell array for a categorical predictor is empty because the software does not bin categorical predictors. The software bins numeric predictors only if you specify the You can reproduce the binned predictor data X = mdl.X;% Xbinned = 0(大小(X预测数据)); edges = mdl.BinEdges; % Find indices of binned predictors. idxNumeric = find(~cellfun(@isempty,edges)); if iscolumn(idxNumeric) idxNumeric = idxNumeric'; end for j = idxNumeric x = X(:,j); % Convert x to array if x is a table. if istable(x) x = table2array(x); end % Group x into bins by using the
Xbinned contains the bin indices, ranging from 1 to the number of bins, for numeric predictors.Xbinned values are 0 for categorical predictors. IfX containsNaN s, then the correspondingXbinned values areNaN s. |
|
Categorical predictor indices, specified as a vector of positive integers. |
|
Ann-by-2 cell array, where |
|
Ann-by-2 array containing the numbers of the child nodes for each node in |
|
Ann-by-2 cell array of the categories used at branches in
|
|
Ann-element vector of the values used as cut points in |
|
Ann-element cell array indicating the type of cut at each node in
|
|
Ann-element cell array of the names of the variables used for branching in each node in
|
|
Ann-element array of numeric indices for the variables used for branching in each node in |
|
Expanded predictor names, stored as a cell array of character vectors. If the model uses encoding for categorical variables, then |
|
Description of the cross-validation optimization of hyperparameters, stored as a
|
|
Ann-element logical vector |
|
Object holding parameters of |
|
Number of observations in the training data, a numeric scalar. |
|
Ann-element vector |
|
Ann-element numeric array with mean values in each node of |
|
Ann-element vector |
|
Ann-element vector of the risk of the nodes in the tree, wherenis the number of nodes. The risk for each node is the node error weighted by the node probability. |
|
Ann-element vector |
|
The number of nodes |
|
Ann-element vector |
|
A cell array of names for the predictor variables, in the order in which they appear in |
|
Numeric vector with one element per pruning level. If the pruning level ranges from 0 toM, then |
|
Ann-element numeric vector with the pruning levels in each node of |
|
A character vector that specifies the name of the response variable ( |
|
Function handle for transforming the raw response values (mean squared error). The function handle must accept a matrix of response values and return a matrix of the same size. The default Add or change a tree.ResponseTransform = @function |
|
Ann-element logical vector indicating which rows of the original predictor data ( |
|
Ann-element cell array of the categories used for surrogate splits in |
|
Ann-element cell array of the numeric cut assignments used for surrogate splits in |
|
Ann-element cell array of the numeric values used for surrogate splits in |
|
Ann-element cell array indicating types of surrogate splits at each node in |
|
Ann-element cell array of the names of the variables used for surrogate splits in each node in |
|
Ann-element cell array of the predictive measures of association for surrogate splits in |
|
The scaled |
|
A matrix or table of predictor values. Each column of |
|
A numeric column vector with the same number of rows as |
Object Functions
compact |
Compact regression tree |
crossval |
Cross-validated decision tree |
cvloss |
Regression error by cross validation |
gather |
Gather properties ofStatistics and Machine Learning Toolboxobject from GPU |
lime |
Local interpretable model-agnostic explanations (LIME) |
loss |
Regression error |
nodeVariableRange |
Retrieve variable range of decision tree node |
partialDependence |
Compute partial dependence |
plotPartialDependence |
Create partial dependence plot (PDP) and individual conditional expectation (ICE) plots |
predict |
Predict responses using regression tree |
predictorImportance |
Estimates of predictor importance for regression tree |
prune |
Produce sequence of regression subtrees by pruning |
resubLoss |
Regression error by resubstitution |
resubPredict |
Predict resubstitution response of tree |
shapley |
Shapley values |
surrogateAssociation |
Mean predictive measure of association for surrogate splits in regression tree |
view |
View regression tree |
Copy Semantics
Value. To learn how value classes affect copy operations, seeCopying Objects.
Examples
References
[1] Breiman, L., J. Friedman, R. Olshen, and C. Stone.Classification and Regression Trees. Boca Raton, FL: CRC Press, 1984.