Main Content

Regression Trees

Binary decision trees for regression

To interactively grow a regression tree, use the Regression Learner app. For greater flexibility, grow a regression tree using fitrtree at the command line. After growing a regression tree, predict responses by passing the tree and new predictor data to predict.


Regression LearnerTrain regression models to predict data using supervised machine learning


RegressionTree PredictPredict responses using regression tree model (Since R2021a)


expand all

fitrtreeFit binary decision tree for regression
compactReduce size of regression tree model
pruneProduce sequence of regression subtrees by pruning regression tree
limeLocal interpretable model-agnostic explanations (LIME) (Since R2020b)
nodeVariableRangeRetrieve variable range of decision tree node (Since R2020a)
partialDependenceCompute partial dependence (Since R2020b)
permutationImportancePredictor importance by permutation (Since R2024a)
plotPartialDependenceCreate partial dependence plot (PDP) and individual conditional expectation (ICE) plots
predictorImportanceEstimates of predictor importance for regression tree
surrogateAssociationMean predictive measure of association for surrogate splits in regression tree
shapleyShapley values (Since R2021a)
viewView regression tree
crossvalCross-validate machine learning model
cvlossRegression error by cross-validation for regression tree model
kfoldfunCross-validate function for regression
kfoldPredictPredict responses for observations in cross-validated regression model
kfoldLossLoss for cross-validated partitioned regression model
lossRegression error for regression tree model
resubLossResubstitution loss for regression tree model
predictPredict responses using regression tree model
resubPredictPredict response of regression tree by resubstitution
gatherGather properties of Statistics and Machine Learning Toolbox object from GPU (Since R2020b)


RegressionTreeRegression tree
CompactRegressionTreeCompact regression tree
RegressionPartitionedModelCross-validated regression model