Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is f-measure for each class in weka

When we evaluate a classifier in WEKA, for example a 2-class classifier, it gives us 3 f-measures: f-measure for class 1, for class 2 and the weighted f-measure.

I'm so confused! I thought f-measure is a balanced measure that show balanced performance measure for multiple class, so what does f-measure for class 1 and 2 mean?

like image 438
MSepehr Avatar asked Jan 24 '14 21:01

MSepehr


People also ask

What is F-measure in classification?

The F-score, also called the F1-score, is a measure of a model's accuracy on a dataset. It is used to evaluate binary classification systems, which classify examples into 'positive' or 'negative'.

What does F-measure measure?

In statistical analysis of binary classification, the F-score or F-measure is a measure of a test's accuracy.

What is the F-measure for Class 2?

Once precision and recall have been calculated for a binary or multiclass classification problem, the two scores can be combined into the calculation of the F-Measure. The traditional F measure is calculated as follows: F-Measure = (2 * Precision * Recall) / (Precision + Recall)

What is F-measure in confusion matrix?

Metrics derived from the confusion matrix TN = true negative. FP = false positive. FN = false negative. TP = true positive.


1 Answers

The f-score (or f-measure) is calculated based on the precision and recall. The calculation is as follows:

Precision = t_p / (t_p + f_p)
Recall = t_p / (t_p + f_n)
F-score = 2 * Precision * Recall / (Precision + Recall)

Where t_p is the number of true positives, f_p the number of false positives and f_n the number of false negatives. Precision is defined as the fraction of elements correctly classified as positive out of all the elements the algorithm classified as positive, whereas recall is the fraction of elements correctly classified as positive out of all the positive elements.

In the multiclass case, each class i have a respective precision and recall, in which a "true positive" is an element predicted to be in i is really in it and a "true negative" is an element predicted to not be in i that isn't in it.

Thus, with this new definition of precision and recall, each class can have its own f-score by doing the same calculation as in the binary case. This is what Weka's showing you.

The weighted f-score is a weighted average of the classes' f-scores, weighted by the proportion of how many elements are in each class.

like image 63
agarie Avatar answered Dec 16 '22 07:12

agarie