Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

InvalidParameterError when using ExtraTreesRegressor #1137

Open
chrisk314 opened this issue Dec 12, 2022 · 1 comment · May be fixed by #1184
Open

InvalidParameterError when using ExtraTreesRegressor #1137

chrisk314 opened this issue Dec 12, 2022 · 1 comment · May be fixed by #1184

Comments

@chrisk314
Copy link

As per the title, when attempting to use the ExtraTreesRegressor class an sklearn.utils._param_validation.InvalidParameterError exception is raised as below.

sklearn.utils._param_validation.InvalidParameterError: The 'criterion' parameter of ExtraTreesRegressor must be a str among {'squared_error', 'poisson', 'friedman_mse', 'absolute_error'}. Got 'mse' instead.

The ExtraTreesRegressor.criterion attribute is set using a default optional argument to the constructor with the value mse. It looks like this criterion value was removed in sklearn 1.2 as per this commit.

It should be an easy fix. Just requires changing the default argument for criterion to either friedman_mse or squared_error I guess... Not sure which one of these would be most appropriate as the default...

@froggleston
Copy link

According to the sklearn docs, mse should be replaced with squared_error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants