Description Usage Arguments Details Value References See Also
Run k-fold cross validation to validate a classification model
1 2 3 |
X |
matrix/ dataframe of predictors, e.g. EFA
coefficients/ PC scores selected using |
Y |
vector giving the class, e.g. value obtained from
|
method |
method |
k |
fold number of cross-validation |
threshold |
optional. A numeric value between 0-1 to
set the threshold of posterior probility. Any class
prediction with posterior probility lower than this value
will be |
Both version computes k-fold cross validation, however there are some differences in features:
kfcv
gives the result of prediction on each specimen.
kfcv2
comes with the ability to calculate the by-class statistics
(recall, precision and specificity). It also calculate confusion matrices for
each folds.
What the stat values mean:
Recall = Sensitivity = tp / (tp + fn)
Precision = tp / (tp + fp)
Specificity = tn / (tn + fp)
and, tp= true positive, tn=true negative, fp=false positive, fn=false negative Please refer to reference for detailed explanation.
misclass |
vector of k values of misclassification rate in percent resulted from each fold of testing |
total |
total
number of prediction after excluding the ones lower than
threshold, if |
ind.prediction |
[ |
stat |
[ |
conmat |
[ |
Sokolova, M., & Lapalme, G. (2009). A systematic analysis of performance measures for classification tasks. Information Processing & Management, 45(4), 427-437.
Function that wraps this function: mrkfcv
, mrkfcv2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.