zachmayer / caretEnsemble

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

Makes all CaretList's regression predictions be numeric #239

Closed Malhadas closed 5 years ago

Malhadas commented 6 years ago

Caret not always returns numeric or factor predictions, instead sometimes it returns them as character wich results in errors in the caretEnsemble and caretStack functions. The underlying packages that implement the models themselves are in constant change and cannot be 100% trusted to always give the numeric values caretEnsemble and caretStack expect. In order to solve this issue, the line if(!is.null(model)) model$pred$pred <- as.numeric(model$pred$pred) can be added on the caretList function.

lintr-bot commented 6 years ago

R/caretList.R:236:71: style: Trailing whitespace is superfluous.

​    if(!is.null(model)) model$pred$pred <- as.numeric(model$pred$pred)               
                                                                      ^~~~~~~~~~~~~~~

R/caretList.R:246:1: style: Trailing whitespace is superfluous.

​      
^~~~~~

R/caretList.R:247:1: style: Trailing whitespace is superfluous.

​      
^~~~~~
coveralls commented 6 years ago

Coverage Status

Coverage decreased (-31.6%) to 65.139% when pulling e80fad56e62ecb855aa63eb4e7e8981f2efb604e on Malhadas:patch-1 into 48e6ecd65fa53e3255162a867454fcd289b98307 on zachmayer:master.

ran88dom99 commented 6 years ago

I have this problem. https://github.com/zachmayer/caretEnsemble/issues/210

Malhadas commented 5 years ago

I have this problem. #210

The solution I proposed worked for me and has not given me any problem yet