Skip to content

Instantly share code, notes, and snippets.

@sriyoda
Last active April 2, 2016 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sriyoda/4006c9f14d97731c5b3da0074b39df6c to your computer and use it in GitHub Desktop.
Save sriyoda/4006c9f14d97731c5b3da0074b39df6c to your computer and use it in GitHub Desktop.
train.y <- train$TARGET
train$TARGET <- NULL
train$TARGET <- train.y
train_new <- sparse.model.matrix(TARGET ~ ., data = train)
dtrain <- xgb.DMatrix(data=train_new, label=train.y)
watchlist <- list(train=dtrain)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment