Cross-validation.

MAPD.CV(model, fold = 20, metric = "ROC", out = "curve")

Arguments

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.

Value

The output depends the `out` parameter. Could be a ROC/PRC object or AUC value or prediction scores collected from the cross-validation.

Note

This function merges predicted probability from each recursion (each-fold of samples) and evaluate the performance based on prediction scores for all samples.