user2326956
user2326956

Reputation:

How to find the Precision, Recall, Accuracy using SVM?

Duplicate calculating Precision, Recall and F Score

I have a input file with text description and classified level (i.e.levelA and levelB). I want to write a SVM classifier that measure precision, recall and accuracy. I looked at scikit and LIBSVM but I want to know more step by step.

Any sample code or basic tutorial would be really nice. Thanks for any suggestion in advance.

Upvotes: 6

Views: 20928

Answers (1)

Marc Claesen
Marc Claesen

Reputation: 17026

These performance measures are easy to obtain from the predicted labels and true labels, as a post-processing step:

  1. Precision = TP / (TP+FP)
  2. Recall = TP / (TP+FN)
  3. Accuracy = (TP + TN) / (TP + TN + FP + FN)

With TP, FP, TN, FN being number of true positives, false positives, true negatives and false negatives, respectively.

Upvotes: 10

Related Questions