Skip to content

Commit 7ac4f89

Browse files
authored
DOC Elaborate on the criterion used for poisson regression using decision trees. (scikit-learn#29230)
1 parent 13a1791 commit 7ac4f89

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

doc/modules/tree.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,17 +552,18 @@ Mean Squared Error:
552552
553553
H(Q_m) = \frac{1}{n_m} \sum_{y \in Q_m} (y - \bar{y}_m)^2
554554
555-
Half Poisson deviance:
555+
Mean Poisson deviance:
556556

557557
.. math::
558558
559-
H(Q_m) = \frac{1}{n_m} \sum_{y \in Q_m} (y \log\frac{y}{\bar{y}_m}
559+
H(Q_m) = \frac{2}{n_m} \sum_{y \in Q_m} (y \log\frac{y}{\bar{y}_m}
560560
- y + \bar{y}_m)
561561
562562
Setting `criterion="poisson"` might be a good choice if your target is a count
563563
or a frequency (count per some unit). In any case, :math:`y >= 0` is a
564564
necessary condition to use this criterion. Note that it fits much slower than
565-
the MSE criterion.
565+
the MSE criterion. For performance reasons the actual implementation minimizes
566+
the half mean poisson deviance, i.e. the mean poisson deviance divided by 2.
566567

567568
Mean Absolute Error:
568569

sklearn/tree/_classes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ class DecisionTreeRegressor(RegressorMixin, BaseDecisionTree):
10981098
mean squared error with Friedman's improvement score for potential
10991099
splits, "absolute_error" for the mean absolute error, which minimizes
11001100
the L1 loss using the median of each terminal node, and "poisson" which
1101-
uses reduction in Poisson deviance to find splits.
1101+
uses reduction in the half mean Poisson deviance to find splits.
11021102
11031103
.. versionadded:: 0.18
11041104
Mean Absolute Error (MAE) criterion.

0 commit comments

Comments
 (0)