Repository navigation
[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 |
Laurae2
left a comment
There was a problem hiding this comment.
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 CHECKNOTE:In this PR, I cut the runtime for our examples by:
library(lightgbm)(these are not necessary and it is conventional to omit them)nroundsfrom10Lto smaller numbers in all examples with training\donttest\donttestThese 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 CHECKnote. We test all those functions in unit tests, so if we break the functions themselves we'll know about it.Won't using
nrounds = 5Land 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.