# 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`.

## Apps

 Regression Learner Train regression models to predict data using supervised machine learning

## Functions

expand all

 `fitrtree` Fit binary decision tree for regression `compact` Compact regression tree `prune` Produce sequence of regression subtrees by pruning
 `cvloss` Regression error by cross validation `plotPartialDependence` Create partial dependence plot (PDP) and individual conditional expectation (ICE) plots `predictorImportance` Estimates of predictor importance for regression tree `view` View regression tree
 `crossval` Cross-validated decision tree `kfoldfun` Cross validate function `kfoldPredict` Predict response for observations not used for training `kfoldLoss` Cross-validation loss of partitioned regression model
 `loss` Regression error `resubLoss` Regression error by resubstitution
 `predict` Predict responses using regression tree `resubPredict` Predict resubstitution response of tree

## Classes

 `RegressionTree` Regression tree `CompactRegressionTree` Compact regression tree `RegressionPartitionedModel` Cross-validated regression model

## Topics

Train Regression Trees Using Regression Learner App

Create and compare regression trees, and export trained models to make predictions for new data.

Supervised Learning Workflow and Algorithms

Understand the steps for supervised learning and the characteristics of nonparametric classification and regression functions.

Decision Trees

Understand decision trees and how to fit them to data.

Growing Decision Trees

To grow decision trees, `fitctree` and `fitrtree` apply the standard CART algorithm by default to the training data.

View Decision Tree

Create and view a text or graphic description of a trained decision tree.

Improving Classification Trees and Regression Trees

Tune trees by setting name-value pair arguments in `fitctree` and `fitrtree`.

Prediction Using Classification and Regression Trees

Predict class labels or responses using trained classification and regression trees.

Predict Out-of-Sample Responses of Subtrees

Predict responses for new data using a trained regression tree, and then plot the results.
{"ft_lang_label":"__label__en","ft_lang_prob":0.7527203,"math_prob":0.6532697,"size":1460,"snap":"2020-24-2020-29","text_gpt3_token_len":278,"char_repetition_ratio":0.20192307,"word_repetition_ratio":0.0,"special_character_ratio":0.15616438,"punctuation_ratio":0.076576576,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9953234,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-06-02T18:42:47Z\",\"WARC-Record-ID\":\"<urn:uuid:ff469dfa-ee55-4feb-b491-e1fcadb42038>\",\"Content-Length\":\"77095\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:f9a4a07d-aa09-4e7a-b518-8290781699e3>\",\"WARC-Concurrent-To\":\"<urn:uuid:d4760867-b1fb-4dc8-bb5f-13a53ceb6418>\",\"WARC-IP-Address\":\"104.110.193.39\",\"WARC-Target-URI\":\"https://it.mathworks.com/help/stats/regression-trees.html?s_tid=CRUX_lftnav\",\"WARC-Payload-Digest\":\"sha1:UUVRQN2HCR4DKNHGYTLZB7XUQ5CFLXQ7\",\"WARC-Block-Digest\":\"sha1:YC3KE6MA4SWU5I7X5NZ6VQZCAI3SHA36\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-24/CC-MAIN-2020-24_segments_1590347425481.58_warc_CC-MAIN-20200602162157-20200602192157-00164.warc.gz\"}"}