I got a problem understanding the meaning of the finalModel when using a repeated CV.
ctrl = trainControl(method="repeatedcv", number=10, repeats = 300, savePredictions = TRUE, classProbs = TRUE)
mdl = train("Label~.", data=Data, method = "glm", trControl = ctrl)
pred = predict(mdl, newdata = Data, type="prob")
roc.1 = roc(Data$Label, pred$control)
roc.2 = roc(mdl$pred$obs,mdl$pred$control)
from what I understand :
- In roc.1 I tested the "finalModel" of the rCV training on all my database then build the ROC curve associated to this "finalModel".
- In roc.2 I build the "average" ROC curve using all the rCV process results.
What I don't get is: what does the "finalModel" represent?
- Is it a model averaging all the trained models coefficients?
- Is it correct to use it a predictive model (on both the training dataset and a different set)?