Accuracy Score :
Accuracy score is a metric used to evaluate the performance of a classification model. It is the ratio of the number of correct predictions made by the model to the total number of predictions made. In other words, it measures the proportion of predictions made by the model that are correct.
For example, consider a classification model that is trained to predict whether a customer will churn or not. The model makes 100 predictions and out of these, 90 predictions are correct. In this case, the accuracy score of the model is 90/100 = 0.9.
A higher accuracy score indicates that the model has a higher prediction accuracy and is able to make more correct predictions. However, it is important to note that accuracy score is not always a reliable metric for evaluating the performance of a classification model. This is because it does not take into account the underlying class distribution in the dataset.
For instance, consider a dataset with two classes: Class A and Class B. Class A has 90% of the data and Class B has 10% of the data. If a model always predicts Class A, then it will have an accuracy score of 0.9. However, this model is not performing well as it is not considering the minority class (Class B) at all.
Therefore, in such cases, it is important to use other evaluation metrics such as precision, recall, and F1 score, which take into account the class distribution in the dataset.
Precision is the ratio of the number of true positive predictions to the total number of positive predictions made by the model. It measures the proportion of positive predictions made by the model that are actually correct.
For example, consider a model that is trained to predict whether an email is spam or not. The model makes 100 predictions and out of these, 80 predictions are spam. Out of these 80 spam predictions, 70 are actually spam emails. In this case, the precision of the model is 70/80 = 0.875.
Recall is the ratio of the number of true positive predictions to the total number of actual positive examples in the dataset. It measures the proportion of actual positive examples that the model is able to correctly predict.
For example, consider the same model as above. Out of 100 emails in the dataset, 80 are actually spam. Out of these 80 spam emails, the model is able to correctly predict 70 of them. In this case, the recall of the model is 70/80 = 0.875.
F1 score is the harmonic mean of precision and recall. It is a balanced metric that takes into account both precision and recall. A model with a higher F1 score is considered to be performing better as it is able to make both accurate and relevant predictions.
For example, consider the same model as above. The precision of the model is 0.875 and the recall is 0.875. The F1 score of the model is 2 * (0.875 * 0.875) / (0.875 + 0.875) = 0.875.
In conclusion, accuracy score is a useful metric for evaluating the performance of a classification model. However, it is not always reliable as it does not take into account the class distribution in the dataset. In such cases, it is important to use other evaluation metrics such as precision, recall, and F1 score for a more comprehensive evaluation of the model.