Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2f99cda

Browse filesBrowse files
101AlexMartinAlexMGTNOjeremiedbbglemaitre
authored
API replace mean_squared_error(square=False) by root_mean_squared_error (#26734)
Co-authored-by: Alejandro Martin <alejandro.martingil@tno.nl> Co-authored-by: jeremie du boisberranger <jeremiedbb@yahoo.fr> Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com> Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
1 parent 1fbf5fb commit 2f99cda
Copy full SHA for 2f99cda

File tree

Expand file treeCollapse file tree

9 files changed

+310
-26
lines changed
Filter options
Expand file treeCollapse file tree

9 files changed

+310
-26
lines changed

‎doc/modules/classes.rst

Copy file name to clipboardExpand all lines: doc/modules/classes.rst
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,8 @@ details.
995995
metrics.median_absolute_error
996996
metrics.mean_absolute_percentage_error
997997
metrics.r2_score
998+
metrics.root_mean_squared_log_error
999+
metrics.root_mean_squared_error
9981000
metrics.mean_poisson_deviance
9991001
metrics.mean_gamma_deviance
10001002
metrics.mean_tweedie_deviance

‎doc/modules/model_evaluation.rst

Copy file name to clipboardExpand all lines: doc/modules/model_evaluation.rst
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ Scoring Function
9494
'max_error' :func:`metrics.max_error`
9595
'neg_mean_absolute_error' :func:`metrics.mean_absolute_error`
9696
'neg_mean_squared_error' :func:`metrics.mean_squared_error`
97-
'neg_root_mean_squared_error' :func:`metrics.mean_squared_error`
97+
'neg_root_mean_squared_error' :func:`metrics.root_mean_squared_error`
9898
'neg_mean_squared_log_error' :func:`metrics.mean_squared_log_error`
99+
'neg_root_mean_squared_log_error' :func:`metrics.root_mean_squared_log_error`
99100
'neg_median_absolute_error' :func:`metrics.median_absolute_error`
100101
'r2' :func:`metrics.r2_score`
101102
'neg_mean_poisson_deviance' :func:`metrics.mean_poisson_deviance`
@@ -2310,6 +2311,10 @@ function::
23102311
for an example of mean squared error usage to
23112312
evaluate gradient boosting regression.
23122313

2314+
Taking the square root of the MSE, called the root mean squared error (RMSE), is another
2315+
common metric that provides a measure in the same units as the target variable. RSME is
2316+
available through the :func:`root_mean_squared_error` function.
2317+
23132318
.. _mean_squared_log_error:
23142319

23152320
Mean squared logarithmic error
@@ -2347,6 +2352,9 @@ function::
23472352
>>> mean_squared_log_error(y_true, y_pred)
23482353
0.044...
23492354

2355+
The root mean squared logarithmic error (RMSLE) is available through the
2356+
:func:`root_mean_squared_log_error` function.
2357+
23502358
.. _mean_absolute_percentage_error:
23512359

23522360
Mean absolute percentage error

‎doc/whats_new/v1.4.rst

Copy file name to clipboardExpand all lines: doc/whats_new/v1.4.rst
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,18 @@ Changelog
238238
- |Enhancement| :class:`preprocessing.TargetEncoder` now supports `target_type`
239239
'multiclass'. :pr:`26674` by :user:`Lucy Liu <lucyleeow>`.
240240

241+
:mod:`sklearn.metrics`
242+
......................
243+
244+
- |API| The `squared` parameter of :func:`metrics.mean_squared_error` and
245+
:func:`metrics.mean_squared_log_error` is deprecated and will be removed in 1.6.
246+
Use the new functions :func:`metrics.root_mean_squared_error` and
247+
:func:`root_mean_squared_log_error` instead.
248+
:pr:`26734` by :user:`Alejandro Martin Gil <101AlexMartin>`.
249+
250+
- |Enhancement| Added `neg_root_mean_squared_log_error_scorer` as scorer
251+
:pr:`26734` by :user:`Alejandro Martin Gil <101AlexMartin>`.
252+
241253
:mod:`sklearn.model_selection`
242254
..............................
243255

‎sklearn/metrics/__init__.py

Copy file name to clipboardExpand all lines: sklearn/metrics/__init__.py
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
mean_tweedie_deviance,
6363
median_absolute_error,
6464
r2_score,
65+
root_mean_squared_error,
66+
root_mean_squared_log_error,
6567
)
6668
from ._scorer import check_scoring, get_scorer, get_scorer_names, make_scorer
6769
from .cluster import (
@@ -166,6 +168,8 @@
166168
"RocCurveDisplay",
167169
"roc_auc_score",
168170
"roc_curve",
171+
"root_mean_squared_log_error",
172+
"root_mean_squared_error",
169173
"get_scorer_names",
170174
"silhouette_samples",
171175
"silhouette_score",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.