zachmayer / caretEnsemble

caret models all the way down :turtle:
Other
226 stars 75 forks source link

The number of predictors used to fit the model and those in `newdata' does not match #186

Closed ignl closed 8 years ago

ignl commented 8 years ago

Hello,

I cannot get to use brnn model with caret ensemble and get error as in the title. After debuging I saw that training data that reached predict.brnn method had additional column named .outcome . However I haven't tracked yet where and why it was added. At that time predict.brnn checks how many columns training data has and fails if number is not the same as number of predictors. Direct brnn model prediction worked fine when exctracting model from ensemble. So this column must have been added in ensemble predict method by design or by accident. I hope you can provide a bit more info on this. Best regards, Ignas

ignl commented 8 years ago

Ok it seems this strange thing happened because I did not named my training set parameter as newdata=

ignl commented 8 years ago

Maybe it could be nice to add a check for newdata parameter and provide correct error message if it is missing (failing early principle). For example I again got this error when I copy pasted ensemble model to another predict function which was without newdata parameter and worked correctly with single model.