Confusion Matrix

Somasree Majumder
3 min readApr 25, 2022

Introduction

Machine learning is about building a prediction model using historical data to make predictions on new data when you do not have the answer to a particular question. Since, the output is a possibility, checking your predictions becomes an important step. There are many ways you can judge how well your machine learning model works and most of all focus on minimizing the error between real and predictable business because you may want your prediction to be clearer.

Supervised learning algorithms, where you have information about labels such as category, and unconventional learning algorithms when you do not have the label knowledge as a combination, have different test metrics depending on their results. In this post, you will explore some of the most popular test metrics for planning, and integration problems.

Classification Performance Evaluation Metrics

Predictions give more information than just right or wrong. Because for example, you could analyze the accuracy of each class (how many were predicted to survive but died or survived). In binary options, you can be wrong in two ways:

Predict 0 if the correct value is 1, or predict 1 when the correct value is 0. Inside, in the same way, you can be true in two ways. In many divisions, it is helpful to skip the precise calculations and to check the accuracy of the class intelligence, or class confusion. It is already useful to show these four numbers in a double diagram called the confusion matrix.

Each element in the matrix indicates the accuracy of the phase framework or the confusion between good and bad categories. connects a specific matrix of confusion with the general concept of receiver performance (ROCs) features that you will use extensively throughout the book. Although these words may be confusing at first, they will be important when talking to other people about it performance of your model. The reason for demonstrating the accuracy of class intelligence in the form of a matrix is ​​to use our excellent visual skills to process additional information.

ROC curve

It applies to binary separation problems only because it separates predictions into positive and negative categories to find similar ROC metrics the true-true rate and the false positive rate commonly used in the ROC axis curve. To simulate a two-step division in a multi-stage problem, you use the one-against-everything trick. In each class, you refer to a particular class as a good class and all-something like a negative phase, and you draw the ROC curve as usual

a. Understanding the Confusion Matrix:

The following 4 are basic words that will help us determine the metrics we want.

True Positive (TP): when the real value is Positive and the predicted is also positive.

True Negative (TN): if the real value is negative and the prediction is also negative.

False Good (FP): If the real is negative but the prediction is Good. Also known as type 1 error

False Opposition (FN): If the real is Good but the prediction is Bad. Also known as type 2 error.

There are other dimensions besides the confusion matrix that can help achieve a better understanding and analysis of our model and its functionality.

a. Accuracy

b Remember (TPR, Sensitivity)

c.F1-Score

d. FPR (Type Error)

e. FNR (Type II Error)

a. Accuracy:

Accuracy simply determines how often a section maker makes an accurate prediction. The ratio between the number of relevant predictions and the total number of predictions.

Accurate metrics are not suitable for unequal classes. Accuracy has its own conditions, with unequal data, where the model predicts that each point is a multi-stage label, accuracy will be high. However, the model is incorrect.

It is a measure of accuracy found inaccurate predictions. In simple terms, it tells us how many good predictions in all the good predictions are complete.

Accuracy is a valid choice for the evaluation of well-balanced and straightforward or non-uniform classification problems.

--

--