[R] docs update - callbacks and parameter style
This commit is contained in:
@@ -4,19 +4,21 @@
|
||||
\alias{xgb.plot.multi.trees}
|
||||
\title{Project all trees on one tree and plot it}
|
||||
\usage{
|
||||
xgb.plot.multi.trees(model, feature_names = NULL, features.keep = 5,
|
||||
plot.width = NULL, plot.height = NULL)
|
||||
xgb.plot.multi.trees(model, feature_names = NULL, features_keep = 5,
|
||||
plot_width = NULL, plot_height = NULL, ...)
|
||||
}
|
||||
\arguments{
|
||||
\item{model}{dump generated by the \code{xgb.train} function.}
|
||||
|
||||
\item{feature_names}{names of each feature as a \code{character} vector. Can be extracted from a sparse matrix (see example). If model dump already contains feature names, this argument should be \code{NULL}.}
|
||||
|
||||
\item{features.keep}{number of features to keep in each position of the multi trees.}
|
||||
\item{features_keep}{number of features to keep in each position of the multi trees.}
|
||||
|
||||
\item{plot.width}{width in pixels of the graph to produce}
|
||||
\item{plot_width}{width in pixels of the graph to produce}
|
||||
|
||||
\item{plot.height}{height in pixels of the graph to produce}
|
||||
\item{plot_height}{height in pixels of the graph to produce}
|
||||
|
||||
\item{...}{currently not used}
|
||||
}
|
||||
\value{
|
||||
Two graphs showing the distribution of the model deepness.
|
||||
@@ -39,7 +41,7 @@ its deepness (therefore in a boosting model, all trees have the same shape).
|
||||
Moreover, the trees tend to reuse the same features.
|
||||
|
||||
The function will project each tree on one, and keep for each position the
|
||||
\code{features.keep} first features (based on Gain per feature measure).
|
||||
\code{features_keep} first features (based on Gain per feature measure).
|
||||
|
||||
This function is inspired by this blog post:
|
||||
\url{https://wellecks.wordpress.com/2015/02/21/peering-into-the-black-box-visualizing-lambdamart/}
|
||||
@@ -47,11 +49,11 @@ This function is inspired by this blog post:
|
||||
\examples{
|
||||
data(agaricus.train, package='xgboost')
|
||||
|
||||
bst <- xgboost(data = agaricus.train$data, label = agaricus.train$label, max.depth = 15,
|
||||
eta = 1, nthread = 2, nround = 30, objective = "binary:logistic",
|
||||
bst <- xgboost(data = agaricus.train$data, label = agaricus.train$label, max_depth = 15,
|
||||
eta = 1, nthread = 2, nrounds = 30, objective = "binary:logistic",
|
||||
min_child_weight = 50)
|
||||
|
||||
p <- xgb.plot.multi.trees(model = bst, feature_names = agaricus.train$data@Dimnames[[2]], features.keep = 3)
|
||||
p <- xgb.plot.multi.trees(model = bst, feature_names = colnames(agaricus.train$data), features_keep = 3)
|
||||
print(p)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user