From 8485d3eb5ccee1fef9600b9b711e7a572794ba09 Mon Sep 17 00:00:00 2001 From: Warut Vijitbenjaronk Date: Mon, 17 Jul 2017 12:02:18 -0500 Subject: [PATCH] [MRG] Add Explanation of MSE vs Friedman MSE vs MAE criterion in Regression Tree Building (#9367) * clarified documentation for regression tree criterion * added explanation on doc/modules/tree.rst --- doc/modules/tree.rst | 5 ++++- sklearn/tree/tree.py | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/modules/tree.rst b/doc/modules/tree.rst index f793c34b7f53d..3f577795e24be 100644 --- a/doc/modules/tree.rst +++ b/doc/modules/tree.rst @@ -481,7 +481,10 @@ Regression criteria If the target is a continuous value, then for node :math:`m`, representing a region :math:`R_m` with :math:`N_m` observations, common -criteria to minimise are +criteria to minimise as for determining locations for future +splits are Mean Squared Error, which minimizes the L2 error +using mean values at terminal nodes, and Mean Absolute Error, which +minimizes the L1 error using median values at terminal nodes. Mean Squared Error: diff --git a/sklearn/tree/tree.py b/sklearn/tree/tree.py index 93db4eb98f34e..099f3da39a45b 100644 --- a/sklearn/tree/tree.py +++ b/sklearn/tree/tree.py @@ -879,8 +879,11 @@ class DecisionTreeRegressor(BaseDecisionTree, RegressorMixin): criterion : string, optional (default="mse") The function to measure the quality of a split. Supported criteria are "mse" for the mean squared error, which is equal to variance - reduction as feature selection criterion, and "mae" for the mean - absolute error. + reduction as feature selection criterion and minimizes the L2 loss + using the mean of each terminal node, "friedman_mse", which uses mean + squared error with Friedman's improvement score for potential splits, + and "mae" for the mean absolute error, which minimizes the L1 loss + using the median of each terminal node. .. versionadded:: 0.18 Mean Absolute Error (MAE) criterion.