-
Notifications
You must be signed in to change notification settings - Fork 540
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
[FEA] Accept NumPy (and CuPy) RandomState objects as estimator random_state #4753
Comments
It its worth noting that NumPy is moving away from
The new API is CuPy has implemented this ( cupy/cupy#4177 ) in 9.0.0. Dask is working on it ( dask/dask#9038 ). Scikit-learn is moving in this direction ( scikit-learn/scikit-learn#22271 ) ( scikit-learn/scikit-learn#22327 ) This isn't to say there isn't value in supporting |
This would happen after we just refactored the RAFT RNG API to follow the random_state model. |
Good to know, thanks for sharing the new API and adoption progress John. Sounds like unfortunate timing. Perhaps it makes sense to support RandomState for now in cuML Python to unblock users (as legacy usage will probably persist for a while) and then eventually design for / explore the Generator API in RAFT? There is still significant usage of RandomState (via a utility function) in sickit-learn, for example. |
Would suggest looking at the scikit-learn PRs linked (in particular the changes therein). They seem to be able to gracefully handle both APIs. So think it should be possible for us to do the same |
I have made an initial draft here. There are some issues that I would like to point out.
|
I'll see if we can reboot the PR or do something else to fix this |
Many estimators provide a
random_state
parameter to let users provide seeds for random number generators. Scikit-learn estimators can accept either an integer or anumpy.random.RandomState
forrandom_state
, and some PyData ecosystem tools (e.g. Boruta) passRandomStates
to estimators, so it would be nice if we could accept these as well.Conceptually, it's possible to generate an integer from a RandomState object fairly efficiently. Perhaps this might be a path forward?
cc @teju85 , as we were chatting about Boruta earlier.
The text was updated successfully, but these errors were encountered: