Skip to content
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

[dask] [docs] Fix inaccuracies in API docs for Dask module (fixes #3871) #3930

Merged
merged 8 commits into from
Feb 9, 2021

Conversation

jameslamb
Copy link
Collaborator

@jameslamb jameslamb commented Feb 9, 2021

This PR proposes a fix to #3871.

  • corrects type information (e.g. to say "dask Array" instead of "array-like")
  • removes docs for keyword args that aren't currently supported (like init_score and various eval_* arguments)
  • removes docs for custom objective, since that isn't supported yet (TODO: I'll write up a feature request tomorrow)

To minimize duplication, this PR moves the sklearn docstrings into template strings that are then formatted with .format(). This indirection is a little confusing, but we can at least rely on getting CI failures in the check-docs task, since .format() has to fill all template values.

"{a} - {b}".format(a="hello")

# KeyError: 'b'

Notes for Reviewers

  • I opened this PR on the docs/jlamb branch so we can check on readthedocs builds: https://lightgbm.readthedocs.io/en/docs-jlamb/Python-API.html.
  • there are two places in LGBMModel.__init__ that have references that are incorrect for Dask, but when I tried to templatize it I got errors from Sphinx like LGBMClassifier.__init__:66:Inline strong start-string without end-string.. I'll try some more things, but it's ok if we can't figure out how to fix that for this PR since we're trying to get a release out (v3.2.0 release #3872 ) and the inaccuracies are minor.
    • learning_rate docs that says "you can use callbacks..."
    • objective doc that references scikit-learn classes ("Default: ‘regression’ for LGBMRegressor...")

@jameslamb jameslamb added the doc label Feb 9, 2021
@jameslamb jameslamb marked this pull request as ready for review February 9, 2021 06:14
@jameslamb jameslamb changed the title [dask] [docs] Fix inaccuracies in API docs for Dask module [dask] [docs] Fix inaccuracies in API docs for Dask module (fixes #3871) Feb 9, 2021
Copy link
Collaborator

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jameslamb I love how you introduced shared templates for docstrings! However, I think there are some mistakes, that I noted below:

python-package/lightgbm/sklearn.py Outdated Show resolved Hide resolved
python-package/lightgbm/dask.py Outdated Show resolved Hide resolved
python-package/lightgbm/dask.py Outdated Show resolved Hide resolved
python-package/lightgbm/dask.py Outdated Show resolved Hide resolved
python-package/lightgbm/dask.py Outdated Show resolved Hide resolved
python-package/lightgbm/dask.py Outdated Show resolved Hide resolved
python-package/lightgbm/dask.py Outdated Show resolved Hide resolved
python-package/lightgbm/dask.py Outdated Show resolved Hide resolved
python-package/lightgbm/sklearn.py Show resolved Hide resolved
Co-authored-by: Nikita Titov <nekit94-08@mail.ru>
Copy link
Collaborator

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the consistency:

python-package/lightgbm/dask.py Outdated Show resolved Hide resolved
python-package/lightgbm/dask.py Outdated Show resolved Hide resolved
python-package/lightgbm/dask.py Outdated Show resolved Hide resolved
Co-authored-by: Nikita Titov <nekit94-08@mail.ru>
Copy link
Collaborator

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

@jameslamb
Copy link
Collaborator Author

the most recent build on RTD did pass: https://readthedocs.org/projects/lightgbm/builds/12979086/

And docs look ok to me! https://lightgbm.readthedocs.io/en/docs-jlamb/Python-API.html

For example, here's DaskLGBMRanker.fit()

image

And the sklearn docs look unchanged.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants