cuml icon indicating copy to clipboard operation
cuml copied to clipboard

Make `get_param_names` a class method on single GPU estimators to match Scikit-learn closer

Open dantegd opened this issue 1 year ago • 3 comments

Small difference between our estimators and Scikit-learn is that get_param_names are a classmethod in sklearn, and not in ours. This can make a few corner cases fail for using our estimators when Scikit-learn like estimators are expected. This PR fixes that.

Note: This will not include dask-based estimators for the time being since they depend on introspection at object creation time.

dantegd avatar Oct 07 '24 22:10 dantegd

lol because I wrote a script to do this and only checked .py files instead of .pyx files too

dantegd avatar Oct 08 '24 00:10 dantegd

Do you want to make them private at the same time? On the one hand, then we'd be 100% the same. On the other hand, the fact that they are private in scikit-learn makes me wonder if this matters (as they aren't part of the public API)?

betatim avatar Oct 14 '24 09:10 betatim

@betatim good point, I think matching as close as possible (i.e. entirely) is a good idea

dantegd avatar Oct 16 '24 14:10 dantegd

It is a big rename diff :D

Looks good from a quick check. One thing I noticed: some are classmethods (the majority) but some aren't. Oversight? If on purpose it is maybe worth adding a comment to the ones that aren't to help people from the future understand why they are different.

betatim avatar Nov 11 '24 11:11 betatim

@betatim the ones that haven't changed to be class methods are the dask-based estimators, currently they depend on some runtime behavior, I would suggest we do those on a follow up

dantegd avatar Nov 11 '24 22:11 dantegd

Ok. Maybe they don't need a comment then.

Time to merge?

betatim avatar Nov 12 '24 13:11 betatim

/merge

dantegd avatar Nov 12 '24 16:11 dantegd