Skip to content

Commit

Permalink
feature_scoring: fix Regressor criterion depreciation
Browse files Browse the repository at this point in the history
scikit-learn 1.1 depreciated the use of "mse" as regression criterion, and replaced it with "squared_error". This commit fixes two of those instances in analysis/feature_scoring.py.

"""Deprecated since version 1.0: Criterion “mse” was deprecated in v1.0 and will be removed in version 1.2. Use criterion="squared_error" which is equivalent."""
  • Loading branch information
EwoutH committed May 16, 2022
1 parent a99b71b commit 6a443d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ema_workbench/analysis/feature_scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def get_rf_feature_scores(
criterion = "gini"
elif mode == RuleInductionType.REGRESSION:
rfc = RandomForestRegressor
criterion = "mse"
criterion = "squared_error"
else:
raise ValueError(f"{mode} not valid for mode")

Expand Down Expand Up @@ -316,7 +316,7 @@ def get_ex_feature_scores(
criterion = "gini"
elif mode == RuleInductionType.REGRESSION:
etc = ExtraTreesRegressor
criterion = "mse"
criterion = "squared_error"
else:
raise ValueError(f"{mode} not valid for mode")

Expand Down

0 comments on commit 6a443d5

Please sign in to comment.