-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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] Working on Roxygen documentation #10674
Conversation
R-package/NAMESPACE
Outdated
@@ -10,10 +10,8 @@ S3method(getinfo,xgb.Booster) | |||
S3method(getinfo,xgb.DMatrix) | |||
S3method(length,xgb.Booster) | |||
S3method(predict,xgb.Booster) | |||
S3method(print,xgb.Booster) |
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.
Not sure what's the implication of changing ,
to .
. I know this is generated, but not familiar enough with R type system to understand the change.
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.
This pops up on my side since quite some months. I can easily undo this change.
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.
I'm okay with the changes as they are generated. I am just curious about the implications. We run doc gen on the CI as well, not sure what's the cause of the change.
#' at different stages of model training (before / after training, before / after each boosting | ||
#' iteration). | ||
#' | ||
#' @details | ||
#' Arguments that will be passed to the supplied functions are as follows: |
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.
I will leave it to @david-cortes for detailed reviews.
Some comments:
|
@david-cortes : The file "xgb.DMatrix.R" with the unintended code block in its help file is one of the files I have not worked on yet. Thus, you should not expect it to look great. I am fixing these things on the fly. As an illustration that such issues are easy to fix, see my latest commit in this PR: A good and compact description of rmarkdown in Roxygen Latex formulas are still the same, e.g., like this: #' @section Partial Dependence Functions:
#'
#' Let \eqn{F: R^p \to R} denote the prediction function that maps the
#' \eqn{p}-dimensional feature vector \eqn{\mathbf{x} = (x_1, \dots, x_p)}
#' to its prediction. Furthermore, let
#' \deqn{
#' F_s(\mathbf{x}_s) = E_{\mathbf{x}_{\setminus s}}(F(\mathbf{x}_s, \mathbf{x}_{\setminus s}))
#' }
#' be the partial dependence function of \eqn{F} on the feature subset
#' \eqn{\mathbf{x}_s}, where \eqn{s \subseteq \{1, \dots, p\}}, as introduced in
#' Friedman (2001). |
I will look into #10330 first to avoid potential conflicts. |
R-package/NAMESPACE
Outdated
@@ -10,10 +10,8 @@ S3method(getinfo,xgb.Booster) | |||
S3method(getinfo,xgb.DMatrix) | |||
S3method(length,xgb.Booster) | |||
S3method(predict,xgb.Booster) | |||
S3method(print,xgb.Booster) |
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.
I think this will break existing behaviors
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.
This is part of the work on the new R interface: #9810
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.
It shouldn't be related to the changes in other PRs. In the current master branch, triggering docs build with roxygen doesn't remove the S3 method exports.
Removing the S3 exports would indeed break things elsewhere.
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.
R-package/NAMESPACE
Outdated
export(print.xgb.Booster) | ||
export(print.xgboost) |
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.
Did we remove any explicit s3 export statements?
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.
I have added a commit that fixes the problem by adding the roxygen tags @method print xgboost
and @method print xgb.Booster
. The NAMESPACE file is now untouched.
Hi @mayer79 , I have merged @david-cortes 's PR, could you please help rebase this one? |
Great. Glad that we caught this earlier in the PR. |
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.
Overall looks good to me, mostly reformating and reording the existing document, please let me know if there's anything specific that I should pay closer attention.
I will merge the PR if there's no further comment from @david-cortes .
After the merge, I will try to update the remaining files. Not so much is left now! |
Step towards
#9875
After this, only a few R scripts are left for switching to the markdown style.