# Confusion Matrix

## What is 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. The matrix compares the actual target values with those predicted by the machine learning model. This gives us a holistic view of how well our classification model is performing and what kinds of errors it is making.

• The actual value was positive and the model predicted a positive value
• The actual value was negative and the model predicted a negative value
• The actual value was negative but the model predicted a positive value
• Also known as the Type 1 error
• The actual value was positive but the model predicted a negative value
• Also known as the Type 2 error
• True Negative (TN) = 330; meaning 330 negative class data points were correctly classified by the model
• False Positive (FP) = 60; meaning 60 negative class data points were incorrectly classified as belonging to the positive class by the model
• True Negative (TN) = 330; meaning 330 negative class data points were correctly classified by the model
• False Positive (FP) = 60; meaning 60 negative class data points were incorrectly classified as belonging to the positive class by the model

# Cyber crime using confusion matrix:

Cyber-attacks have become one of the biggest problems of the world. They cause serious financial damages to countries and people every day. The increase in cyber-attacks also brings along cyber-crime.