Cross-validation.
MAPD.CV(model, fold = 20, metric = "ROC", out = "curve")
model | A caret model returned by the train function. |
---|---|
fold | An integer, specifying the fold for cross validation. |
metric | A character, One of ROC and PRC. |
out | A character, specifying the type of output. Should be one of curve, AUC, F1, and Pred. |
The output depends the `out` parameter. Could be a ROC/PRC object or AUC value or prediction scores collected from the cross-validation.
This function merges predicted probability from each recursion (each-fold of samples) and evaluate the performance based on prediction scores for all samples.