-
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
[R-package] Error during basic_walkthrough.R example script #3583
Comments
@jameslamb any ideas about this? I think we had tested these demos in cran. |
Thanks for the thorough report and for using LightGBM @tonyk7440 ! I just installed from
I'd welcome a pull request, but calling that function in the demos isn't the right fix. Lines 197 to 198 in 1ee7c29
I think it will be a little complicated, but the fix should be:
If you're interested and have the time this week, we'd welcome the contribution. If not just let me know and I'll fix this.
The examples in the package are tested, but not these demos. So these demos definitely need some attention. Whenever we switch from demos to "vignettes" (#1944 ), they'll be tested by |
@jameslamb Ok great, I will try what you have suggested above! Hopefully will have the pull request ready to review this week I am a little confused about your third bullet point though. I presume you want to add a test to |
Thanks!
The error you hit is because when you ran So the test should look like this: test_that("should be able to train immediately after using lgb.Dataset() on a file", {
dtest <- lgb.Dataset(test_data, label = test_label)
tmp_file <- tempfile("lgb.Dataset_")
lgb.Dataset.save(dtest, tmp_file)
# read from a local file
dtest_read_in <- lgb.Dataset(tmp_file)
# should be able to train right away
bst <- lgb.train(params, dtest_read_in)
expect_true(lgb.is.Booster(bst))
}) |
Oh! I realize now that in my third bullet, I made a mistake. That was supposed to say "and then another test like that for |
…3583) (#3598) * construct dataset earlier in lgb.train and lgb.cv * Update R-package/tests/testthat/test_dataset.R Co-authored-by: James Lamb <[email protected]> * Update R-package/R/lgb.cv.R Co-authored-by: James Lamb <[email protected]> * Update R-package/R/lgb.train.R Co-authored-by: James Lamb <[email protected]> * Update R-package/tests/testthat/test_dataset.R Co-authored-by: James Lamb <[email protected]> * fixing lint issues * styling updates * fix failing test Co-authored-by: James Lamb <[email protected]>
This issue 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. |
How you are using LightGBM?
LightGBM component: R package
Environment info
Operating System: Windows 10 Pro 1909
R version: 4.0.2
LightGBM version or commit hash: 3.1.0 via CRAN
Error message and / or logs
While stepping through the first example basic_walkthrough.R I encountered an error on line 155.
Reproducible example(s)
Created on 2020-11-21 by the reprex package (v0.3.0)
Steps to reproduce
install.packages("lightgbm")
I did some debugging and found that adding
after the dataset is reloaded fixes the issue.
Would you like me to submit a pull request using this suggested fix for above?
Lastly many thanks for the great work on this package!
The text was updated successfully, but these errors were encountered: