Repository navigation
[python-package] simplify processing of pandas data - #6066
Conversation
|
Thanks a lot for this! I agree that function has got quite complicated and it's great that you've found the time to simplify it. Sorry I haven't been able to review this, I'll provide a review in the following days. |
|
Thanks @jmoralez , no rush! I have a few other PRs I'm planning like this as well, trying to simplify the flow of the code to make it easier for contributors. |
|
There's something wrong with this PR, I can't approve it. I've tried from web, phone and gh CLI and I get the same error on all.
I'll try later today if that's ok with you. |
|
Yep no problem! GitHub is experiencing an outage in some services today. |
|
thanks @jmoralez ! |
|
This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this. |
Contributes to #3756.
Contributes to #3867.
The Python package has an internal utility function,
_data_from_pandas(), which takes inpandasDataFrames and extracts from them:numpyformatThat function is quite complicated (in my opinion), and some logic hidden in there doesn't actually relate to
pandasDataframes.This PR proposes the following to simplify the Python package's code:
_data_from_pandasonpandasDataFramesfeature_nameandcategorical_featurecould be set toNone"auto", or (categorical_feature only) a list of integer column indicesThis makes it easier for humans reading the code and for type-checking tools like
mypyto understand the flow of data through the package.Notes for Reviewers
This will be easier to review if you apply the "Hide whitespace" changes in the GitHub diff view.