Skip to content

Commit 074cad2

Browse files
mayer79trivialfis
andauthored
[R] Finalizes switch to markdown doc (dmlc#10733)
--------- Co-authored-by: Jiaming Yuan <[email protected]>
1 parent 479ae80 commit 074cad2

37 files changed

+1273
-1216
lines changed

R-package/R/callbacks.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
#' It should match with argument `nrounds` passed to [xgb.train()] or [xgb.cv()].
5757
#'
5858
#' Note that boosting might be interrupted before reaching this last iteration, for
59-
#' example by using the early stopping callback \link{xgb.cb.early.stop}.
59+
#' example by using the early stopping callback [xgb.cb.early.stop()].
6060
#' - iteration Index of the iteration number that is being executed (first iteration
6161
#' will be the same as parameter `begin_iteration`, then next one will add +1, and so on).
6262
#'

R-package/R/xgb.Booster.R

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,11 @@ xgb.get.handle <- function(object) {
222222
#' For multi-class and multi-target, will be a 4D array with dimensions `[nrows, ngroups, nfeats+1, nfeats+1]`
223223
#' }
224224
#'
225-
#' If passing `strict_shape=FALSE`, the result is always an array:\itemize{
226-
#' \item For normal predictions, the dimension is `[nrows, ngroups]`.
227-
#' \item For `predcontrib=TRUE`, the dimension is `[nrows, ngroups, nfeats+1]`.
228-
#' \item For `predinteraction=TRUE`, the dimension is `[nrows, ngroups, nfeats+1, nfeats+1]`.
229-
#' \item For `predleaf=TRUE`, the dimension is `[nrows, niter, ngroups, num_parallel_tree]`.
230-
#' }
225+
#' If passing `strict_shape=FALSE`, the result is always an array:
226+
#' - For normal predictions, the dimension is `[nrows, ngroups]`.
227+
#' - For `predcontrib=TRUE`, the dimension is `[nrows, ngroups, nfeats+1]`.
228+
#' - For `predinteraction=TRUE`, the dimension is `[nrows, ngroups, nfeats+1, nfeats+1]`.
229+
#' - For `predleaf=TRUE`, the dimension is `[nrows, niter, ngroups, num_parallel_tree]`.
231230
#'
232231
#' If passing `avoid_transpose=TRUE`, then the dimensions in all cases will be in reverse order - for
233232
#' example, for `predinteraction`, they will be `[nfeats+1, nfeats+1, ngroups, nrows]`
@@ -623,7 +622,7 @@ validate.features <- function(bst, newdata) {
623622
#' change the value of that parameter for a model.
624623
#' Use [xgb.parameters<-()] to set or change model parameters.
625624
#'
626-
#' The [xgb.attributes<-()] setter either updates the existing or adds one or several attributes,
625+
#' The `xgb.attributes<-` setter either updates the existing or adds one or several attributes,
627626
#' but it doesn't delete the other existing attributes.
628627
#'
629628
#' Important: since this modifies the booster's C object, semantics for assignment here
@@ -635,11 +634,11 @@ validate.features <- function(bst, newdata) {
635634
#' @param object Object of class `xgb.Booster`. **Will be modified in-place** when assigning to it.
636635
#' @param name A non-empty character string specifying which attribute is to be accessed.
637636
#' @param value For `xgb.attr<-`, a value of an attribute; for `xgb.attributes<-`,
638-
#' it is a list (or an object coercible to a list) with the names of attributes to set
639-
#' and the elements corresponding to attribute values.
640-
#' Non-character values are converted to character.
641-
#' When an attribute value is not a scalar, only the first index is used.
642-
#' Use `NULL` to remove an attribute.
637+
#' it is a list (or an object coercible to a list) with the names of attributes to set
638+
#' and the elements corresponding to attribute values.
639+
#' Non-character values are converted to character.
640+
#' When an attribute value is not a scalar, only the first index is used.
641+
#' Use `NULL` to remove an attribute.
643642
#' @return
644643
#' - `xgb.attr()` returns either a string value of an attribute
645644
#' or `NULL` if an attribute wasn't stored in a model.

R-package/R/xgb.DMatrix.R

Lines changed: 230 additions & 224 deletions
Large diffs are not rendered by default.

R-package/R/xgb.DMatrix.save.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
#'
33
#' Save xgb.DMatrix object to binary file
44
#'
5-
#' @param dmatrix the \code{xgb.DMatrix} object
5+
#' @param dmatrix the `xgb.DMatrix` object
66
#' @param fname the name of the file to write.
77
#'
88
#' @examples
99
#' \dontshow{RhpcBLASctl::omp_set_num_threads(1)}
10-
#' data(agaricus.train, package='xgboost')
10+
#' data(agaricus.train, package = "xgboost")
11+
#'
1112
#' dtrain <- with(agaricus.train, xgb.DMatrix(data, label = label, nthread = 2))
1213
#' fname <- file.path(tempdir(), "xgb.DMatrix.data")
1314
#' xgb.DMatrix.save(dtrain, fname)

R-package/R/xgb.config.R

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1+
#' Set and get global configuration
2+
#'
13
#' Global configuration consists of a collection of parameters that can be applied in the global
24
#' scope. See \url{https://xgboost.readthedocs.io/en/stable/parameter.html} for the full list of
3-
#' parameters supported in the global configuration. Use \code{xgb.set.config} to update the
4-
#' values of one or more global-scope parameters. Use \code{xgb.get.config} to fetch the current
5+
#' parameters supported in the global configuration. Use `xgb.set.config()` to update the
6+
#' values of one or more global-scope parameters. Use `xgb.get.config()` to fetch the current
57
#' values of all global-scope parameters (listed in
68
#' \url{https://xgboost.readthedocs.io/en/stable/parameter.html}).
9+
#'
710
#' @details
811
#' Note that serialization-related functions might use a globally-configured number of threads,
912
#' which is managed by the system's OpenMP (OMP) configuration instead. Typically, XGBoost methods
10-
#' accept an `nthreads` parameter, but some methods like `readRDS` might get executed before such
13+
#' accept an `nthreads` parameter, but some methods like [readRDS()] might get executed before such
1114
#' parameter can be supplied.
1215
#'
1316
#' The number of OMP threads can in turn be configured for example through an environment variable
1417
#' `OMP_NUM_THREADS` (needs to be set before R is started), or through `RhpcBLASctl::omp_set_num_threads`.
1518
#' @rdname xgbConfig
16-
#' @title Set and get global configuration
1719
#' @name xgb.set.config, xgb.get.config
1820
#' @export xgb.set.config xgb.get.config
1921
#' @param ... List of parameters to be set, as keyword arguments
2022
#' @return
21-
#' \code{xgb.set.config} returns \code{TRUE} to signal success. \code{xgb.get.config} returns
23+
#' `xgb.set.config()` returns `TRUE` to signal success. `xgb.get.config()` returns
2224
#' a list containing all global-scope parameters and their values.
2325
#'
2426
#' @examples

0 commit comments

Comments
 (0)