xgboost

0th

Percentile

eXtreme Gradient Boosting (Tree) library

A simple interface for xgboost in R

Usage
xgboost(data = NULL, label = NULL, params = list(), nrounds,
  verbose = 1, ...)
Arguments
data
takes matrix, dgCMatrix, local data file or xgb.DMatrix.
label
the response variable. User should not set this field,
params
the list of parameters. Commonly used ones are:
  • objectiveobjective function, common ones are
    • reg:linearlinear regression
    • binary:logisticlogistic regression for classification
nrounds
the max number of iterations
verbose
If 0, xgboost will stay silent. If 1, xgboost will print information of performance. If 2, xgboost will print information of both performance and construction progress information
...
other parameters to pass to params.
Details

This is the modeling function for xgboost.

Parallelization is automatically enabled if OpenMP is present. Number of threads can also be manually specified via "nthread" parameter

Aliases
  • xgboost
Examples
data(agaricus.train, package='xgboost')
data(agaricus.test, package='xgboost')
train <- agaricus.train
test <- agaricus.test
bst <- xgboost(data = train$data, label = train$label, max.depth = 2,
               eta = 1, nround = 2,objective = "binary:logistic")
pred <- predict(bst, test$data)
Documentation reproduced from package xgboost, version 0.3-1, License: Apache License (== 2.0) | file LICENSE

Community examples

Looks like there are no examples yet.