svm.accuracy: Measure accuracy scoreof a prediction

Description Usage Arguments Examples

View source: R/svm.utils.R

Description

Calculates accuracy of a prediction, returns precent of correctly predicted examples over all test examples.

Usage

1
svm.accuracy(prediction, target)

Arguments

prediction

factor or 1 dim vector with predicted classes

target

factor or 1 dim vector with true classes

#'

Examples

1
2
3
4
5
6
7
8
## Not run: 
# firstly, SVM model needs to be trained
svm <- SVM(x, y, core="libsvm", kernel="linear", C=1)
# then we can use it to predict unknown samples
p <- predcit(svm, x_test)
acc <- svm.accuracy(p, y)

## End(Not run)

gmum.r documentation built on May 29, 2017, 3:52 p.m.