Day 5 - Performance metrics in Machine Learning - Classification
Performance metrics in ML
Evaluation of the performance of a model is important. Performance metrics are certain measures to quantify the performance of the model during the training and testing phases. In Machine learning, there are generally two kinds of performance metrics in use. For regression models and for classification models. Below are the most popular metrics in use:
Classification Metrics
- Confusion Matrix (Not a metric but base to others)
It is a visualization of ground truth vs predicted values, in the form of a matrix. It is not exactly a performance metric but forms a basis for other metrics. Each cell consists of one term, which is an evaluation factor.
- TP
This indicates how many positive cases are predicted correctly - FP
This indicates the number of cases in which the value is actually negative but predicted as positive. This factor represents Type-I error in statistics. - FN
This indicates the values which are actually positive but predicted as negative
This factor represents Type-II error in statistics. - TN
This indicates the number of correct negative predictions
2. Accuracy
It is the simplest metric of all. It is the ratio of total correct predictions to the total number of predictions.
3. Precision
It is the ratio of true positives and total positives predicted. Here cost of acting is High. An example of a case where precision is important is Spam classification.
5. F1-Score
6. AUROC (Area under Receiver operating characteristics curve)
TPR represents how many positives are guessed correctly. FPR represents how many negatives are mistakenly considered as positives.
To combine the FPR and the TPR into a single metric, we first compute the two metrics with many different thresholds for the logistic regression, then plot them on a single graph. The resulting curve is called the ROC curve, and the metric we consider is the area under this curve, which we call AUROC.
An excellent model has AUC near to 1 which means it has a good measure of separability. A poor model has an AUC near 0 which means it has the worst measure of separability. And when AUC is 0.5, it means the model has no class separation capacity.
I am doing a challenge - #66DaysofData in which I will be learning something new from the Data Science field for 66 days, and I will be posting daily topics on my LinkedIn, On my GitHub repository, and on my blog as well.







The article provides a clear introduction to performance evaluation for machine learning classification models. The explanation begins with the confusion matrix and its four components—TP, FP, FN, and TN—before moving to accuracy, giving readers a useful foundation for understanding how predicted values are compared with actual values.
ReplyDeleteThe distinction between the confusion matrix and performance metrics is particularly helpful, as the article explains that the matrix forms the basis for other evaluation measures. The discussion of correct positive and negative predictions and the different types of prediction errors provides useful context for learners working through a Machine Learning Course.
The article also introduces accuracy as the ratio of correct predictions to the total number of predictions. These concepts provide a practical starting point for understanding model evaluation and can be connected with implementation-focused Machine Learning Projects for Final Year.
ReplyDelete