Shashwat Gaur
3 min readJun 6, 2021

Role of Confusion Matrix in Cybercrimes.

A confusion matrix is a common term, which is often in talks, whenever Machine learning is being explored. As per the name, the topic has confused may, though it plays a major role in determining decisive factors in the Machine Learning area. Today, in this piece of writing, we will be exploring the confusion matrix, the errors, and the role it plays in Cybercrimes.

A confusion matrix can be treated as a parameter, or a metric to decide the model’s performance, by comparing the actual and the predicted set of values. It is used to determine the factors of accuracy, precision, recall, and sensitivity, which all play a major role in deciding how the model is working.

To get acquainted with what a confusion matrix is, let’s consider two classes- namely, A and B. Consider two terminologies -positive and negative. Let class A be negative and Class B be positive. Now consider an example of the prediction of cancer by a doctor. We have the actual and predicted results with us. If the actual results and the predictions match, these are termed as True Positives(TP) If the actual result is “no cancer”, but the doctor predicts “yes”, it is a False Positives(FP). If the actual result is “Yes cancer” and the doctor also predicts the same it becomes True Negative(TN). However , if the result is “Cancer exists” but the predicted result is “No cancer”, It is called as “False Negative”.

The combination Of these 4 parameters results in the confusion matrix. One important thing to remember is :

Type 1 error: False Positive is termed as Type 1 error.

Type 2 error: False Negative is termed as Type 2 error

Now to keep in mind the list of parameters that could be deduced from the confusion matrix:

Accuracy: Accuracy determines how good is the model. (TP+TN)/Total

Error rate: It is the rate at which the model is wrong? FP+FN/Total

Precision: It determines how many times it is correct out of the total predictions.

TP/ Predicted Yes

Recall: How many times is it correct actually.

TP/ Actual Yes

Considering a machine learning model, the accuracy should be pretty high. Though high accuracy is of paramount importance, Error 1 and 2 sometimes pose a threat. Also, one should remember that there exists a trade-off between precision and recall.

There exist a wide class of cybercrime, which may include stealing of data, identity theft, stealing credentials and hacking for info. Confusion matrix does play an important role in determining the outcome.

This could be explained by an example- if in an intrusion detection system, if the user of the system is denied the entry initially but allowed the next time, it is bearable but if an intruder is allowed an entry recognizing him as a valid user, it may cause a great risk. Hence False positive could be okay, but false negative cant be, So this shows the role of confusion matrix.

Thank You!

Shashwat Gaur
Shashwat Gaur

Written by Shashwat Gaur

0 Followers

A tech enthusiast and an aspirer, aiming to olve real life problems, looking forward with a collaborative mindset. Planning to put the skills to best use.

No responses yet