zachmayer / caretEnsemble

caret models all the way down :turtle:
http://zachmayer.github.io/caretEnsemble/
Other
226 stars 74 forks source link

center/scale option for caretEnsemble #101

Closed zachmayer closed 3 months ago

zachmayer commented 9 years ago

Centering and scaling predictions prior to ensembling might help in some degenerate cases. We'd need to make sure to apply the same centering and scaling to the component models prior to predicting too.

jknowles commented 9 years ago

This is a big one for me actually -- I have a hacky bit of code that does the center/scale on the frontside, then undoes it when you extract the model frame on the back side so that you can plot predictions on the original scale of the variables. Might be a place to start!

zachmayer commented 9 years ago

That's probably the right place to start! I was thinking of using the scale function, and storing the resulting "scaled:center" and "scaled:scale" attributes, e.g.:

x <- scale(matrix(runif(10), ncol=2))
attr(x,"scaled:center")
attr(x,"scaled:scale")
zachmayer commented 9 years ago

That still leaves us with the "un-center" and "un-scale" problem. Another idea would be to use the caret::preProcess function, which has nice predict methods for new data.

zachmayer commented 9 years ago

Oh man, it just occurred to me that supporting a pca transformation might be super useful too, as it will yield completely un-correlated predictors.

It might mess up the print and plot methods that assign weights to each of the component models.

zachmayer commented 3 months ago

caretStack supports all the preprcoessing options for caret::train now