Closed AleBitetto closed 3 years ago
Hi, thanks for reporting this.
The error is in the line results <- predict(model, data = newdata) %>% as.numeric()
.
predict()
used on the linear model automatically calls the predict.lm
function. And the argument for the new data set is called newdata
and not data
. So what happens then is that the lm always returns the default prediction from the training data.
If you replace the line with results <- predict(model, newdata = newdata) %>% as.numeric()
it works
Hi,
I'm trying to use a custom predictor so I'm making some basic test to check reproducibility and prediction validity. I tried a very simple linear model building my custom predictor and comparing the results with the same linear model with default predictor function. The predicted values of the entire dataset with different predictor match, but if I run
FeatImp
I get very different results. Any idea?first output is
second output is
thanks a lot