Description Usage Arguments Value Examples
Downloads and install xgboost from repository. Allows to customize the commit/branch used. Requires git
and compiler make
(or mingw32-make
for MinGW) in PATH
environment variable. Windows uses \\
(backward slashes) while Linux uses /
(forward slashes).
1 2 3 |
commit |
The commit / branch to use. Put |
compiler |
Applicable only to Windows. The compiler to use (either |
repo |
The link to the repository. Defaults to |
cores |
The number of cores to use for compilation, ignored for Visual Studio. Defaults to |
use_gpu |
Whether to install with GPU enabled or not. Defaults to |
use_avx |
Whether to install with AVX enabled or not. Defaults to |
CUDA |
Path to CUDA, gcc, and g++ if cmake does not recognize CUDA path. Defaults to |
NCCL |
Activate NCCL by specifying the path to NCCL. Defaults to |
A logical describing whether the xgboost package was installed or not (TRUE
if installed, FALSE
if installation failed AND you did not have the package before).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | ## Not run:
# Install using Visual Studio 2017
# (Download: http://landinghub.visualstudio.com/visual-cpp-build-tools)
xgb.dl(compiler = "Visual Studio 15 2017 Win64")
# Install using Rtools MinGW or use Linux compilation
xgb.dl(compiler = "gcc")
# Install master using Visual Studio 2017 with GPU support
xgb.dl(commit = "master",
compiler = "Visual Studio 15 2017 Win64",
repo = "https://github.com/dmlc/xgboost",
use_gpu = TRUE)
# Install master using Visual Studio 2017 with GPU support and AVX speedups
xgb.dl(commit = "master",
compiler = "Visual Studio 15 2017 Win64",
repo = "https://github.com/dmlc/xgboost",
use_gpu = TRUE,
use_avx = TRUE)
# Test package
library(xgboost)
data(agaricus.train, package = "xgboost")
data(agaricus.test, package = "xgboost")
dtrain <- xgb.DMatrix(agaricus.train$data, label = agaricus.train$label)
dtest <- xgb.DMatrix(agaricus.test$data, label = agaricus.test$label)
watchlist <- list(train = dtrain, eval = dtest)
param <- list(max_depth = 2, eta = 1, silent = 1, nthread = 2,
objective = "binary:logistic", eval_metric = "auc")
bst <- xgb.train(param, dtrain, nrounds = 2, watchlist)
# Install with GPU support on Linux, CUDA 10 + gcc-6 + g++-6
xgb.dl(compiler = "gcc",
commit = "a2dc929",
use_avx = FALSE,
use_gpu = TRUE,
CUDA = list("/usr/lib/cuda", "/usr/bin/gcc-6", "/usr/bin/g++-6"))
# Test GPU package
library(xgboost)
data(agaricus.train, package = "xgboost")
data(agaricus.test, package = "xgboost")
dtrain <- xgb.DMatrix(agaricus.train$data, label = agaricus.train$label)
dtest <- xgb.DMatrix(agaricus.test$data, label = agaricus.test$label)
watchlist <- list(train = dtrain, eval = dtest)
param <- list(max_depth = 2, eta = 1, silent = 1, nthread = 2,
objective = "binary:logistic", eval_metric = "auc",
max_bin = 64, tree_method = "gpu_hist")
bst <- xgb.train(param, dtrain, nrounds = 2, watchlist)
# Install with multi-GPU support on Linux, CUDA 10 + gcc-6 + g++-6
xgb.dl(compiler = "gcc",
commit = "a2dc929",
use_avx = FALSE,
use_gpu = TRUE,
CUDA = list("/usr/lib/cuda", "/usr/bin/gcc-6", "/usr/bin/g++-6"),
NCCL = "/usr/lib/x86_64-linux-gnu")
# Test Multi-GPU package
library(xgboost)
data(agaricus.train, package = "xgboost")
data(agaricus.test, package = "xgboost")
dtrain <- xgb.DMatrix(agaricus.train$data, label = agaricus.train$label)
dtest <- xgb.DMatrix(agaricus.test$data, label = agaricus.test$label)
watchlist <- list(train = dtrain, eval = dtest)
param <- list(max_depth = 2, eta = 1, silent = 1, nthread = 2,
objective = "binary:logistic", eval_metric = "auc",
max_bin = 64, tree_method = "gpu_hist", n_gpus = 4)
bst <- xgb.train(param, dtrain, nrounds = 2, watchlist)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.