Skip to content

Instantly share code, notes, and snippets.

@HackerEarthBlog
Last active March 15, 2017 11:18
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 HackerEarthBlog/d19647674a1ebaeaec2afd0d46861563 to your computer and use it in GitHub Desktop.
Save HackerEarthBlog/d19647674a1ebaeaec2afd0d46861563 to your computer and use it in GitHub Desktop.
#load package
require(mxnet)
#convert target variables into numeric
train[,target := as.numeric(target)-1]
test[,target := as.numeric(target)-1]
#convert train data to matrix
train.x <- data.matrix(train[,-c("target"),with=F])
train.y <- train$target
#convert test data to matrix
test.x <- data.matrix(test[,-c("target"),with=F])
test.y <- test$target
@itroulli
Copy link

When I convert the target variables into numeric, I get the following warning:
"Warning message:
In eval(expr, envir, enclos) : NAs introduced by coercion"
I checked train and test variables again after that and the whole "target" column is filled with NAs. How can I solve this?
Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment