Skip to content

Commit 526e9cb

Browse files
authored
[R] Update prediction docs (dmlc#11223)
1 parent a39eae1 commit 526e9cb

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

R-package/R/xgb.Booster.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,14 @@ xgb.get.handle <- function(object) {
9494
#' - Columns will be converted to numeric if they aren't already, which could potentially make
9595
#' the operation slower than in an equivalent `matrix` object.
9696
#' - The order of the columns must match with that of the data from which the model was fitted
97-
#' (i.e. columns will not be referenced by their names, just by their order in the data).
97+
#' (i.e. columns will not be referenced by their names, just by their order in the data),
98+
#' unless passing `validate_features = TRUE` (which is not the default).
9899
#' - If the model was fitted to data with categorical columns, these columns must be of
99100
#' `factor` type here, and must use the same encoding (i.e. have the same levels).
100101
#' - If `newdata` contains any `factor` columns, they will be converted to base-0
101102
#' encoding (same as during DMatrix creation) - hence, one should not pass a `factor`
102103
#' under a column which during training had a different type.
104+
#' - Any columns with type other than `factor` will be interpreted as numeric.
103105
#' @param missing Float value that represents missing values in data
104106
#' (e.g., 0 or some other extreme value).
105107
#'

R-package/R/xgboost.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ xgboost <- function(
12501250
#'
12511251
#' In the case of data frames, if there are any categorical features, they should be of class
12521252
#' `factor` and should have the same levels as the `factor` columns of the data from which the model
1253-
#' was constructed.
1253+
#' was constructed. Any columns with type other than `factor` will be interpreted as numeric.
12541254
#'
12551255
#' If there are named columns and the model was fitted to data with named columns, they will be
12561256
#' matched by name by default (see `validate_features`).

R-package/man/predict.xgb.Booster.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

R-package/man/predict.xgboost.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)