add new Gain and Weight columns.

documentation updated.
This commit is contained in:
El Potaeto 2014-12-30 12:32:58 +01:00
parent c754fd4ad0
commit c6f76fab56

View File

@ -1,19 +1,19 @@
#' Show importance of features in a model #' Show importance of features in a model
#' #'
#' Read a xgboost model in text file format. #' Read a xgboost model text dump.
#' Can be tree or linear model (text dump of linear model are only supported in dev version of Xgboost for now). #' 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. #' 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 data.table data.table
#' @importFrom magrittr %>% #' @importFrom magrittr %>%
#' @importFrom data.table := #' @importFrom data.table :=
#' @importFrom stringr str_extract #' @importFrom stringr str_extract
#' @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 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. #' @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}).
#' #'
#' @details #' @details
#' This is the function to understand the model trained (and through your model, your data). #' This is the function to understand the model trained (and through your model, your data).
#'
#' Results are returned for both linear and tree models. #' Results are returned for both linear and tree models.
#' #'
#' \code{data.table} is returned by the function. #' \code{data.table} is returned by the function.