AI Glossary/Accuracy
AI Fundamentals

Accuracy

Accuracy is a metric used in machine learning to measure the percentage of correctly predicted instances in relation to the total number of instances evaluated. It is widely used to assess the performance of classification models.

In-depth explanation

Accuracy is one of the simplest yet most commonly used metrics to evaluate the performance of classification models in machine learning. It is calculated as the ratio of the number of correct predictions to the total number of predictions made. The formula for accuracy is given by: Accuracy = (True Positives + True Negatives) / (Total Instances). The concept of accuracy is straightforward and provides a quick overview of how well a model is performing. Historically, accuracy has been the go-to metric for many classification problems due to its ease of interpretation and calculation. However, it is crucial to understand its limitations, especially in scenarios where class distributions are imbalanced. In such cases, accuracy might give a misleading representation of a model's performance. For instance, in a dataset where 95% of the instances belong to one class, a model that predicts the majority class for all instances will achieve a high accuracy of 95%, despite failing to capture any instances of the minority class. Accuracy is often used alongside other metrics such as precision, recall, and F1-score to provide a more comprehensive evaluation of a model's performance. Precision considers the correctness of positive predictions, while recall measures the model's ability to capture all positive instances. The F1-score is the harmonic mean of precision and recall, offering a balance between the two. In real-world applications, accuracy is a crucial metric in areas such as spam detection, where the goal is to correctly classify emails as spam or not spam, and in medical diagnosis, where accurate classification can significantly impact patient outcomes. However, for tasks like fraud detection or rare disease identification, where the positive class is rare, accuracy alone is insufficient, and other metrics become more relevant. Understanding when and how to use accuracy effectively is essential for AI practitioners. It is important to consider the context of the problem and the distribution of the classes to determine the most appropriate evaluation metric.

Examples

In a binary classification model predicting whether an email is spam or not, an accuracy of 90% means that 90% of the emails were correctly classified.
In a medical test for a disease where only 1% of the population has the disease, a model that predicts no disease for everyone will have 99% accuracy, but this does not reflect the model's ability to detect the disease.
A facial recognition system with an accuracy of 95% correctly identifies individuals in 95 out of 100 cases, but the remaining 5% might include crucial errors depending on the application.

Master Accuracy.

Learn how to apply this concept with hands-on projects in our comprehensive AI programs.