topepo / caret

caret (Classification And Regression Training) R package that contains misc functions for training and plotting classification and regression models
http://topepo.github.io/caret/index.html
1.61k stars 633 forks source link

Breaking Backward Compatibility #508

Closed topepo closed 4 years ago

topepo commented 7 years ago

Not an issue but a running list of things that we might change in a single release that would break backward compatibility (which I have almost always avoided).

Suggestions and comments are welcome...

trainControl(method, number, repeats, p, initialWindow, horizon, fixedWindow, ...)

It might be cleaner to change this to something like:

trainControl(resample = list(method, number, repeats, p, initialWindow, horizon, fixedWindow))

Overall, it would like like:

trainControl(resample = list(method = "boot", 
                             number = ifelse(grepl("cv", method), 10, 25),
                             repeats = ifelse(grepl("cv", method), 1, number), 
                             p = 0.75, 
                             initialWindow = NULL,
                             horizon = 1,
                             fixedWindow = TRUE, 
                             verboseIter = FALSE, 
                             returnData = TRUE),
             search = "grid",
             returnResamp = "final", 
             savePredictions = FALSE, 
             classProbs = FALSE,
             functions = list(summary= defaultSummary, 
                              selection = "best"),
             preProcOptions = list(thresh = 0.95, 
                                   ICAcomp = 3, 
                                   k = 5), 
             sampling = NULL,
             index = list(model = NULL, holdout = NULL, final = NULL), 
             timingSamps = 0,
             predictionBounds = rep(FALSE, 2), 
             seeds = NA, 
             adaptive = list(min = 5,
                             alpha = 0.05, 
                             method = "gls", 
                             complete = TRUE), 
             trim = FALSE,
             allowParallel = TRUE)
dashaub commented 7 years ago

Breaking API is really bad unless necessary for some major reason. A lot of this could be accomplished without breaking any backwards compatibility.

pverspeelt commented 7 years ago

I'm not so concerned with backwards compatibility. Considering the future users that benefit from the changes is better. Constantly worrying about backwards compatibility leads to too many controls in the code and makes debugging worse. Besides, nowadays you have the checkpoint package. This is what I started using for production code. This keeps packages to the same version as when I finished the project. No more worrying about something breaking because someone made a change to a package.

All in all it sounds like a lot of work. Might be a good business case for the R consortium.