Learn R Programming

gmum.r (version 0.2.1)

svm.accuracy: Measure accuracy scoreof a prediction

Description

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

Usage

svm.accuracy(prediction, target)

Arguments

prediction
factor or 1 dim vector with predicted classes
target
factor or 1 dim vector with true classes

#'

Examples

Run this code
## 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)

Run the code above in your browser using DataLab