[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH Consistent loss name for absolute error #19733

Merged
merged 13 commits into from
May 10, 2021
Merged
Prev Previous commit
Next Next commit
TST replace remaining instances of "mae" in test_forest.py
  • Loading branch information
lorentzenchr committed Mar 21, 2021
commit 9a8d1c75179f9b681717ff84932170316ae72425
12 changes: 9 additions & 3 deletions sklearn/ensemble/tests/test_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ def check_regression_criterion(name, criterion):


@pytest.mark.parametrize('name', FOREST_REGRESSORS)
@pytest.mark.parametrize('criterion', ("squared_error", "mae", "friedman_mse"))
@pytest.mark.parametrize('criterion', (
"squared_error", "absolute_error", "friedman_mse"
))
def test_regression(name, criterion):
check_regression_criterion(name, criterion)

Expand Down Expand Up @@ -261,10 +263,14 @@ def check_importances(name, criterion, dtype, tolerance):
itertools.chain(product(FOREST_CLASSIFIERS,
["gini", "entropy"]),
product(FOREST_REGRESSORS,
["squared_error", "friedman_mse", "mae"])))
[
"squared_error",
"friedman_mse",
"absolute_error"
])))
def test_importances(dtype, name, criterion):
tolerance = 0.01
if name in FOREST_REGRESSORS and criterion == "mae":
if name in FOREST_REGRESSORS and criterion == "absolute_error":
tolerance = 0.05
check_importances(name, criterion, dtype, tolerance)

Expand Down