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

[python-package] make some Booster and Dataset attributes private #5723

Merged
merged 2 commits into from
Feb 26, 2023

Conversation

jameslamb
Copy link
Collaborator

@jameslamb jameslamb commented Feb 17, 2023

Contributes to #5313.

Proposes prefixing the following attributes with _, to indicate that user code isn't intended to rely on them.

  • Dataset.need_slice
  • Dataset.params_back_up
  • Booster.network

And removing one unused attribute.

  • Dataset.monotone_constraints

You can see that it's unused by running the following:

git grep -E '\.monotone_constraints'

Notes for Reviewers

See #5313 (comment) for reasons supporting this. That comment mentions a few other properties, but I think making those private will be a bit more controversial and generate more discussion, so I'd like to defer them to a later PR.

@jameslamb
Copy link
Collaborator Author

Thanks for the review, @guolinke !

I'm very happy we're simplifying the public interface with changes like this in the 4.0.0 release 😊

@jameslamb jameslamb merged commit 0b937d1 into master Feb 26, 2023
@jameslamb jameslamb deleted the private-attributes branch February 26, 2023 03:13
@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 15, 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