-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
% Generated by roxygen2 (4.1.1): do not edit by hand | ||
% Please edit documentation in R/svm.utils.R | ||
\name{svm.accuracy} | ||
\alias{svm.accuracy} | ||
\title{Measure accuracy scoreof a prediction} | ||
\usage{ | ||
svm.accuracy(prediction, target) | ||
} | ||
\arguments{ | ||
\item{prediction}{factor or 1 dim vector with predicted classes} | ||
|
||
\item{target}{factor or 1 dim vector with true classes | ||
|
||
#'} | ||
} | ||
\description{ | ||
Calculates accuracy of a prediction, returns precent of correctly predicted examples | ||
over all test examples. | ||
} | ||
\examples{ | ||
\dontrun{ | ||
# 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) | ||
} | ||
} | ||
|