Using CARET package one can perform an analysis on differences between various models obtained using a dataset (the training dataset, trainSet) and the model that best fits the trainSet:
For example, two models were determined using train function, marsFit and rfFit:
resamps <- resamples(list(MARSCV = marsFit,RFCV = rfFit))
summary(resamps)
#Since models are fit on the same versions of the training data we can compute the differences, then use a simple t-test to evaluate the null hypothesis that there is no difference between models.
modelDifferences <- diff(resamps)
summary(modelDifferences)
bwplot(modelDifferences, layout = c(2, 1),
scales = list(x = list(relation="free")))
Is there a way to do a similar analysis (t-test to compare mean values for example) using the model predictions on the test set (separate dataset than trainSet)? CARET has a predict function from which one can evaluate the differences between the observed (testSet) and the predicted (model output) values.
Thanks!