xgboost (version 0.3-0)

slice: Get a new DMatrix containing the specified rows of orginal xgb.DMatrix object

Description

Get a new DMatrix containing the specified rows of orginal xgb.DMatrix object

Usage

slice(object, ...)

## S3 method for class 'xgb.DMatrix': slice(object, idxset, ...)

Arguments

object
Object of class "xgb.DMatrix"
idxset
a integer vector of indices of rows needed
...
other parameters

Examples

Run this code
data(iris)
iris[,5] <- as.numeric(iris[,5])
dtrain <- xgb.DMatrix(as.matrix(iris[,1:4]), label=iris[,5])
dsub <- slice(dtrain, 1:3)

Run the code above in your browser using DataLab