Description Usage Arguments Details Value Source Examples
View source: R/crossValidation.R
Use k-fold cross-validation to guarantee the accuracy and reduce variability of LMDRT-SVM classification in this package.
1 | crossValidation(rawdata, yname, levels, svm = c("svmt"), k = 10)
|
rawdata |
original data set. |
yname |
the name of result-column. |
levels |
results in result-column. |
svm |
type of support vector machine. |
k |
the number of folds in cross-validation. |
One round of cross-validation involves partitioning a sample of data into complementary subsets, performing the analysis on train set, and validating the analysis on test set. To reduce variability, k rounds of cross-validation are performed using different partitions, and the validation results are combined over the rounds to give an estimate of the LMDRT-SVM model's predictive performance.
The function gives the result of prediction combined over k-round validation include confusion matrix and some derivations from it. When TP, TN, FP, FN represent 4 type in confusion matrix respectively, the function gives accuracy(ACC) , positive predictive value (PPV), true positive rate (TPR), true negative rate (TNR) and negative predictive value (NPV).
For cross vaildation, based on Kohavi, Ron (1995). "A study of cross-validation and bootstrap for accuracy estimation and model selection". Proceedings of the Fourteenth International Joint Conference on Artificial Intelligence. San Mateo, CA: Morgan Kaufmann. 2 (12): 1137–1143. CiteSeerX 10.1.1.48.529. Devijver, Pierre A.; Kittler, Josef (1982). Pattern Recognition: A Statistical Approach. London, GB: Prentice-Hall. ISBN 0-13-654236-0.
1 | crossValidation(rawdata, ‘class’, c(‘attack’, ‘normal’), k = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.