I was trying to run a randomForest model on the bike sharing demand problem from kaggle using some given variables and some engineered variables.
and the model->
fit <- randomForest(registered ~ humidity +weather+atemp + day_type + hour + day, data=train, importance=TRUE, ntree=200)
Then I am getting an error and a warning saying ->
Error in randomForest.default(m, y, …) :
NA/NaN/Inf in foreign function call (arg 1)
In addition: Warning message:
In data.matrix(x) : NAs introduced by coercion
This error doesn’t come when I don’t use the day variable. Why is this error coming and how can I get rid of it?