Cybercrime — Confusion Matrix

Moid Khan
2 min readJun 6, 2021

Task 05 — Summer Program 2021

Task Description :

Create a blog about cybercrime cases where they talk about the confusion matrix or its two types of error.

Let us first discuss what is Cybercrime, as Wikipedia suggests Cybercrime is a crime that involves a computer and a network. The computer may have been used in the commission of a crime, or it may be the target. Cybercrime may harm someone’s security and financial health.

There are few or many cases wherein a company where a cyber attack happens and the prediction of the attack plays an important role in knowing whether the attack really did happen or not. To know if the attack has happened, they use a confusion matrix where it gives some of the information they needed. so let’s understand the confusion matrix.

Confusion Matrix

A Confusion matrix is an N x N matrix used for evaluating the performance of a classification model, where N is the number of target classes. It is a table with 4 different combinations of predicted and actual values. The matrix compares the actual target values with those predicted by the machine learning model.

A basic layout for a binary classification problem, we would have a 2 x 2 matrix as shown below with 4 values:

True Positive: True Positive: Predicted values correctly predicted as actual positive

False Positive: Predicted values incorrectly predicted an actual positive. i.e., Negative values predicted as positive. Also known as the Type 1 error

False Negative: False Negative: Positive values predicted as negative. Also known as the Type 2 error

True Negative: True Negative: Predicted values correctly predicted as an actual negative

Accuracy of the model

Accuracy is used when the True Positives and True Negatives are more important. Accuracy is a better metric for Balanced Data.

In the above figure, it can be seen that TN and TP are having the actual and predicted values correct respectively. The accuracy of a model (through a confusion matrix) is calculated by the sum of all true values divided by total values, i.e.,

Accuracy = TN+TP / TN+FP+FN+TP

Accuracy can be misleading if used with imbalanced datasets, and therefore there are other metrics based on confusion matrix which can be useful for evaluating performance.

--

--

Moid Khan

CSE grad | Front end & Blockchain Dev. Looking to make the next best thing in web3 :)