Accuracy

One of the most obvious classification metrics is accuracy:

This provides us with a ratio of all positives predictions to all others. In general, this metric is not very useful because it doesn't show us the real picture in terms of cases with an odd number of classes. Let's consider a spam classification task and assume we have 10 spam letters and 100 non-spam letters. Our algorithm predicted 90 of them correctly as non-spam and classified only 5 spam letters correctly. In this case, accuracy will have the following value:

However, if the algorithm predicts all letters as non-spam, then its accuracy should be as follows:

This example shows that our model still doesn't work because it is unable to predict all the spam letters, but the accuracy value is good enough.

There is a class called ZeroOneLoss in the Shark-ML library that can be used to calculate the accuracy value for classification tasks. We can also use the objects of this class as a target loss function for learning purposes.

In the Shogun library, there's a class called CAccuracyMeasure that can be used to calculate the value of the accuracy.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.5.201