-
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
[docs][R] added R-package docs generation routines #2176
Changes from 8 commits
4a77a8b
3bfb396
97fd9e4
026a781
0720923
606cde5
9ed2216
05404c0
5443dab
014bee1
91925cc
9aed355
2c005db
5912558
e3b2391
8979754
25c2639
da2a9a3
fe55205
ed14839
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: 2 | ||
formats: | ||
python: | ||
version: 3 | ||
install: | ||
- requirements: docs/requirements.txt | ||
sphinx: | ||
builder: html | ||
configuration: docs/conf.py | ||
fail_on_warning: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
^build_package.R$ | ||
\.gitkeep$ | ||
^docs$ | ||
^_pkgdown\.yml$ | ||
|
||
# Objects created by compilation | ||
\.o$ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
#' @importFrom methods is | ||
#' @importFrom R6 R6Class | ||
Predictor <- R6::R6Class( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
#' # $ Petal.Width : num 0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ... | ||
#' # $ Species : int 1 1 1 1 1 1 1 1 1 1 ... | ||
#' | ||
#' \dontrun{ | ||
#' # When lightgbm package is installed, and you do not want to load it | ||
#' # You can still use the function! | ||
#' lgb.unloader() | ||
|
@@ -37,6 +38,7 @@ | |
#' # $ Petal.Length: num 1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ... | ||
#' # $ Petal.Width : num 0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ... | ||
#' # $ Species : int 1 1 1 1 1 1 1 1 1 1 ... | ||
#' } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @StrikerRUS why was this necessary? This will generate a block in the rendered PDF that says "## don't run" (user-facing) I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jameslamb I added this because after calling |
||
#' | ||
#' @export | ||
lgb.prepare2 <- function(data) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,12 +39,11 @@ | |
#' valids <- list(test = dtest) | ||
#' model <- lgb.train(params, | ||
#' dtrain, | ||
#' 100, | ||
#' 10, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you reduce all of these parameters? Was it just to cut the build time on examples? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jameslamb Exactly! BTW, ideally, params for examples should be tuned, because currently we have awful training with huge number of
|
||
#' valids, | ||
#' min_data = 1, | ||
#' learning_rate = 1, | ||
#' early_stopping_rounds = 10) | ||
#' | ||
#' early_stopping_rounds = 5) | ||
#' @export | ||
lgb.train <- function(params = list(), | ||
data, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,12 +116,12 @@ You may also read [Microsoft/LightGBM#912](https://github.com/microsoft/LightGBM | |
Examples | ||
-------- | ||
|
||
Please visit [demo](demo): | ||
|
||
* [Basic walkthrough of wrappers](demo/basic_walkthrough.R) | ||
* [Boosting from existing prediction](demo/boost_from_prediction.R) | ||
* [Early Stopping](demo/early_stopping.R) | ||
* [Cross Validation](demo/cross_validation.R) | ||
* [Multiclass Training/Prediction](demo/multiclass.R) | ||
* [Leaf (in)Stability](demo/leaf_stability.R) | ||
* [Weight-Parameter Adjustment Relationship](demo/weight_param.R) | ||
Please visit [demo](https://github.com/microsoft/LightGBM/tree/master/R-package/demo): | ||
|
||
* [Basic walkthrough of wrappers](https://github.com/microsoft/LightGBM/blob/master/R-package/demo/basic_walkthrough.R) | ||
* [Boosting from existing prediction](https://github.com/microsoft/LightGBM/blob/master/R-package/demo/boost_from_prediction.R) | ||
* [Early Stopping](https://github.com/microsoft/LightGBM/blob/master/R-package/demo/early_stopping.R) | ||
* [Cross Validation](https://github.com/microsoft/LightGBM/blob/master/R-package/demo/cross_validation.R) | ||
* [Multiclass Training/Prediction](https://github.com/microsoft/LightGBM/blob/master/R-package/demo/multiclass.R) | ||
* [Leaf (in)Stability](https://github.com/microsoft/LightGBM/blob/master/R-package/demo/leaf_stability.R) | ||
* [Weight-Parameter Adjustment Relationship](https://github.com/microsoft/LightGBM/blob/master/R-package/demo/weight_param.R) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are all of these being pointed to the repo? From writing R extensions
I recommend reverting this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jameslamb Thanks for catching this. Indeed, this should be reverted, but after we start to generate demos on RTD site. At present, due to that the demo part is not built by
https://lightgbm.readthedocs.io/en/docs/R/index.html#examples |
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.
Fix
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.
haha, a legendary
roxygen2
error 😀