-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[python-packages] [docs] add type hints and define 'array-like' for X, y, group in scikit-learn interface #5757
Conversation
…, y, group in scikit-learn interface
@jmoralez @guolinke @shiyu1994 could I please get a review on this this week? I know it's complicated but I think it's an important step in the development of the Python package. Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, LGTM
Thanks @guolinke ! |
…, y, group in scikit-learn interface (microsoft#5757)
This pull request has been automatically locked since there has not been any recent activity since it was closed. |
Contributes to #3756.
I've been putting this off for a while because it's so complicated, but I think it's finally time... this PR is a first attempt at clarifying the allowed input types for the scikit-learn interface 😬
It proposes the following:
X
,y
, andgroup
infit()
andpredict()
in the scikit-learn interfaceThis PR also expands the
_create_data()
utility function intest_sklearn.py
, adding some things I wanted for this PR like:How I arrived at these lists of types
I tested all of the following for
X
,y
, andgroup
:datatable.Frame
Series
DataFrame
csc_matrix
csr_matrix
At first, I tested this like this:
Then tried adding different combinations of types into the unit tests added in this PR.