From 0abb4338a9b01310dbabefb572fe04acee613b81 Mon Sep 17 00:00:00 2001 From: pommedeterresautee Date: Wed, 2 Dec 2015 15:48:01 +0100 Subject: [PATCH] Cleaning in documentation --- R-package/vignettes/discoverYourData.Rmd | 4 ++-- R-package/vignettes/xgboostPresentation.Rmd | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R-package/vignettes/discoverYourData.Rmd b/R-package/vignettes/discoverYourData.Rmd index 22d996b08..08d6bfdf5 100644 --- a/R-package/vignettes/discoverYourData.Rmd +++ b/R-package/vignettes/discoverYourData.Rmd @@ -190,7 +190,7 @@ Measure feature importance In the code below, `sparse_matrix@Dimnames[[2]]` represents the column names of the sparse matrix. These names are the original values of the features (remember, each binary column == one value of one *categorical* feature). ```{r} -importance <- xgb.importance(sparse_matrix@Dimnames[[2]], model = bst) +importance <- xgb.importance(feature_names = sparse_matrix@Dimnames[[2]], model = bst) head(importance) ``` @@ -213,7 +213,7 @@ One simple solution is to count the co-occurrences of a feature and a class of t For that purpose we will execute the same function as above but using two more parameters, `data` and `label`. ```{r} -importanceRaw <- xgb.importance(sparse_matrix@Dimnames[[2]], model = bst, data = sparse_matrix, label = output_vector) +importanceRaw <- xgb.importance(feature_names = sparse_matrix@Dimnames[[2]], model = bst, data = sparse_matrix, label = output_vector) # Cleaning for better display importanceClean <- importanceRaw[,`:=`(Cover=NULL, Frequency=NULL)] diff --git a/R-package/vignettes/xgboostPresentation.Rmd b/R-package/vignettes/xgboostPresentation.Rmd index 45d2e8b8e..7534240ac 100644 --- a/R-package/vignettes/xgboostPresentation.Rmd +++ b/R-package/vignettes/xgboostPresentation.Rmd @@ -345,7 +345,7 @@ Feature importance is similar to R gbm package's relative influence (rel.inf). ``` importance_matrix <- xgb.importance(model = bst) print(importance_matrix) -xgb.plot.importance(importance_matrix) +xgb.plot.importance(importance_matrix = importance_matrix) ``` View the trees from a model