Skip to content

BaseEstimator.get_params and clone thread-safe are not thread safe #2755

Open
ogrisel opened this Issue Jan 15, 2014 · 3 comments

4 participants

@ogrisel
scikit-learn member
ogrisel commented Jan 15, 2014

The handling of deprecated constructor parameters is leveraging the execution Python warnings machinery which is not thread-safe and could therefore caused hard to diagnose bugs in

There was a tentative lock-based workaround in #2729. A better solution however would avoid executing the warning machinery at all in get_params by leveraging declarative deprecation introspection possibly using a class decorator.

I will try to issue a PR for this next week.

@ogrisel ogrisel was assigned Jan 15, 2014
@GaelVaroquaux
scikit-learn member

What's the status on this?

@ogrisel
scikit-learn member
ogrisel commented Feb 26, 2014

It is still not addressed although as solution based on a class decorator to manage deprecated constructor params declaratively should be possible.

@amueller amueller modified the milestone: 0.15.1, 0.15 Jul 18, 2014
@amueller amueller modified the milestone: 0.16, 0.17 Sep 11, 2015
@stuarteberg

So sorry for the spam, but I just want to +1 this issue. My app calls sklearn (specifically, sklearn.ensemble.RandomForestRegressor.fit()) from multiple threads, and one of my users is running into this snag. It's a shame the Python warnings module isn't thread-safe.

@amueller amueller modified the milestone: 0.18, 0.17 Sep 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.