Page 213 - AI Computer 10
P. 213
Accuracy and Error
In model evaluation, accuracy and error are critical metrics for assessing the performance of machine learning
models. Understanding these concepts helps in determining how well the model performs and identifies the
areas for improvement.
Accuracy
Accuracy refers to how well the model makes correct predictions. It is defined as the percentage of all correct
predictions made by the model out of all the test cases. It is the most straightforward evaluation metric.
The formula for calculating the accuracy of a model is:
Number of correct predictions
Accuracy = × 100
Total number of test cases
Based on the present error, the
AI model parameters are fine
tuned to reduce further error
Input Data AI model Predicted value
Error
Actual value
The accuracy of the model and performance of the model is directly proportional, and hence better the
performance of the model, the more accurate are the predictions.
Error
Error refers to an action or output that is incorrect or wrong. Error measures the discrepancy between a model's
prediction and the actual outcome. It is defined as the percentage of all incorrect predictions made by the
model out of all the test cases. It is used to measure the frequency with which the model produces incorrect
predictions.
The formula for calculating the error of a model is:
Number of incorrect predictions
Error = × 100
Total number of test cases
Imagine you're training a model to predict if the email is spam or not, in such a situation, these two terminologies
can be explained as follows:
u Error: If the model predicts email is not spam, but actually it is, then that's an error.
Spam Email AI Model Prediction Not Spam
Wrong Prediction
There is an error
u Accuracy: If the model correctly predicts spam or not spam emails, then it is accurate.
79
79