diff --git a/R-package/R/xgb.importance.R b/R-package/R/xgb.importance.R index b2e60bed7..2071680d3 100644 --- a/R-package/R/xgb.importance.R +++ b/R-package/R/xgb.importance.R @@ -2,7 +2,6 @@ #' #' Read a xgboost model text dump. #' Can be tree or linear model (text dump of linear model are only supported in dev version of \code{Xgboost} for now). -#' Return a data.table of the features used in the model with their average gain (and their weight for boosted tree model) in the model. #' #' @importFrom data.table data.table #' @importFrom magrittr %>% @@ -11,6 +10,8 @@ #' @param feature_names names of each feature as a character vector. Can be extracted from a sparse matrix (see example). If model dump already contains feature names, this argument should be \code{NULL}. #' @param filename_dump the path to the text file storing the model. Model dump must include the gain per feature and per tree (\code{with.stats = T} in function \code{xgb.dump}). #' +#' @return A \code{data.table} of the features used in the model with their average gain (and their weight for boosted tree model) in the model. +#' #' @details #' This is the function to understand the model trained (and through your model, your data). #' diff --git a/R-package/man/xgb.importance.Rd b/R-package/man/xgb.importance.Rd index 883819993..a7a71cefc 100644 --- a/R-package/man/xgb.importance.Rd +++ b/R-package/man/xgb.importance.Rd @@ -11,10 +11,12 @@ xgb.importance(feature_names = NULL, filename_dump = NULL) \item{filename_dump}{the path to the text file storing the model. Model dump must include the gain per feature and per tree (\code{with.stats = T} in function \code{xgb.dump}).} } +\value{ +A \code{data.table} of the features used in the model with their average gain (and their weight for boosted tree model) in the model. +} \description{ Read a xgboost model text dump. Can be tree or linear model (text dump of linear model are only supported in dev version of \code{Xgboost} for now). -Return a data.table of the features used in the model with their average gain (and their weight for boosted tree model) in the model. } \details{ This is the function to understand the model trained (and through your model, your data).