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

[R-package] remove behavior where lightgbm() saves model to disk #4974

Merged
merged 2 commits into from
Feb 16, 2022

Conversation

david-cortes
Copy link
Contributor

@david-cortes david-cortes commented Jan 23, 2022

ref #4968

The lightgbm() function defaults towards dumping the model to disk in a file named lightgbm.model. After the last series of changes to the serialization logic, this is perhaps not a reasonable default anymore, since now model objects can be serialized natively and will for example survive session restarts in RStudio and similar, so a user fitting a model would not be prone to inadvertently lose it nor need to use this format for model serialization, thus decreasing the need for having a file in disk.

Among modeling packages, it is rather uncommon to produce a file in disk by default - off the top of my head, the only such R libraries that I can think of are xgboost and catboost, while most other packages (which rely on Rds for serialization) do not even have the option of dumping in the function call.

Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

Thanks for this proposal! I left one comment, please wait for another maintainer to respond to me before making any changes.

R-package/R/lightgbm.R Outdated Show resolved Hide resolved
@jameslamb jameslamb changed the title [R-package] Do not produce a model file in disk by default [R-package] remove behavior where lightgbm() saves model to disk Feb 16, 2022
@jameslamb jameslamb self-requested a review February 16, 2022 02:52
Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

Thanks very much! I'm really glad to see this simplification.

@StrikerRUS
Copy link
Collaborator

I'm going to close and instantly re-open this PR to re-trigger Microsoft CLA bot that stuck. Sorry for the inconvenience!

@StrikerRUS StrikerRUS closed this Feb 16, 2022
@StrikerRUS StrikerRUS reopened this Feb 16, 2022
@StrikerRUS StrikerRUS merged commit 9259a53 into microsoft:master Feb 16, 2022
@jameslamb jameslamb mentioned this pull request Oct 7, 2022
40 tasks
@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 23, 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.

None yet

3 participants