-
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] [docs] Simplified examples to cut example run time (fixes #2988) #2989
Conversation
Sorry for maybe stupid question, but I'm still far away from R and learning it only by our conversations here 😃 As we do not wrap them into Lines 12 to 19 in 44a9120
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the learning_rate
to adapt to the hyperparameter changes
@StrikerRUS The examples would fail silently (but still show the error in doc). |
I thought that if you added @Laurae2 is right (#2989 (comment)). I tried adding Results when that example is wrapped in Results with In which case I think the |
Thanks! Just made these changes |
Not sure that the root cause is this PR, but we have the following right now at our docs: https://lightgbm.readthedocs.io/en/latest/R/reference/lgb.cv.html |
Also, it seems that two other examples are broken: https://lightgbm.readthedocs.io/en/latest/R/reference/lgb.Dataset.set.categorical.html |
Thanks @StrikerRUS ! I don't think they are related to this PR. I just created #2999 to address them though, so appreciate you pointing them out! |
See #2988 . The R package is very close to hitting this
R CMD CHECK
NOTE:In this PR, I cut the runtime for our examples by:
library(lightgbm)
(these are not necessary and it is conventional to omit them)nrounds
from10L
to smaller numbers in all examples with training\donttest
\donttest
These tests run in about 2.9 seconds on my laptop. To get the timings for yourself
Results:
To answer some questions I anticipate getting:
Should we really be using
\donttest?
That means CI won't catch those examples being brokenI think it's worth it to get rid of the
R CMD CHECK
note. We test all those functions in unit tests, so if we break the functions themselves we'll know about it.Won't using
nrounds = 5L
and other parameter changes result in terrible models?Yes probably. But we don't have strong guarantees about how well the models from our example code work anyway. I think the role of examples here is just to show minimal valid sets of arguments to each function. See #2988 (comment) for my full opinion on this.