Machine Learning News Hubb
Advertisement Banner
  • Home
  • Machine Learning
  • Artificial Intelligence
  • Big Data
  • Deep Learning
  • Edge AI
  • Neural Network
  • Contact Us
  • Home
  • Machine Learning
  • Artificial Intelligence
  • Big Data
  • Deep Learning
  • Edge AI
  • Neural Network
  • Contact Us
Machine Learning News Hubb
No Result
View All Result
Home Machine Learning

An Introduction to the Confusion Matrix | by Lucas | Sep, 2022

admin by admin
September 10, 2022
in Machine Learning


In this article, I will explain what a confusion matrix is and how you can use it to check the performance of your machine learning classification algorithms. At the end of this article, I will show some references if you want to learn more about the confusion matrix.

What is the confusion matrix?

A Confusion matrix is a valuable table for checking the performance of machine learning classification algorithms by comparing predicted results with the actual results from a test dataset. This table has a dimension NxN, where N is the number of classified categories.
The image below shows an example of a confusion matrix for a binary classification (2×2 Dimension), the simplest confusion matrix you can find, with 1000 test samples. Despite being the simplest confusion matrix, the concepts can be generalized to NxN matrices.

Confusion matrix for a binary classification with 1000 test samples.

In a confusion matrix, as shown above, there are four terminologies used to describe the prediction results, they are:
– True Positive (TP): name is given when both predicted and actual classes are positive.
– True Negative (TN): name is given when both predicted and actual classes are negative.
– False Negative (FN): name is given when the predicted class is negative, but the actual class is positive.
– False Positive (FP): name is given when the predicted class is positive, but the actual class is negative.

Based on these terminologies, we can get interesting measures into the performance of our classification models, such as accuracy, precision, recall and F1-Score.

  • The accuracy measures the percentage of correct predictions of the model. It is calculated as a sum of True Negative and True Positive divided by the total samples.
  • The precision measures the percentage of samples predicted as positive that are actually positive. It is calculated as the division of True Positive by the sum of True Positive and False Positive.
  • The recall measures the percentage of actual positive samples predicted as positive. It is calculated as the division of True Positive by the sum of False Negative and True Positive.

The F1-score (or F-Score) measures the harmonic mean of the precision and recall.

What measure is the most appropriate for evaluating my model?

  • The precision is preferable when the model’s objective is to maximize the True Positive value and minimize the False Positive value. For example, when the model’s goal is to classify spam messages as positive while aiming to minimize the misclassification of non-spam messages.
  • The recall is preferable when the model’s objective is to identify as many actual positive samples as possible because it is a critical situation, for example, the identification of a cancer.
  • Accuracy is preferable when the model’s objective is to classify as many samples as possible correctly. This measure is interesting when the dataset is not unbalanced (You can learn more about unbalanced datasets in “Analytics Vidhya — 5 techniques to handle imbalanced data for a classification problem”).
  • The F1-score is preferable when both precision and recall are important for the model’s accuracy.

To learn more about the confusion matrix I suggest checking the following links:



Source link

Previous Post

Data Science: Linear Regression. Most of us are familiar with a basic… | by Andrew Morse | Sep, 2022

Next Post

How to Best Utilize AI / ML and Creative Humans in 2022 | by Matthew Joseph Taylor | Sep, 2022

Next Post

How to Best Utilize AI / ML and Creative Humans in 2022 | by Matthew Joseph Taylor | Sep, 2022

Difference Between Normalization and Standardization | by Chetan Ambi | Sep, 2022

Saúde & Diagnóstico & Engenharia & Data Science | by Gabrie Freitas | Sep, 2022

Related Post

Artificial Intelligence

Dates and Subqueries in SQL. Working with dates in SQL | by Michael Grogan | Jan, 2023

by admin
January 27, 2023
Machine Learning

ChatGPT Is Here To Stay For A Long Time | by Jack Martin | Jan, 2023

by admin
January 27, 2023
Machine Learning

5 steps to organize digital files effectively

by admin
January 27, 2023
Artificial Intelligence

Explain text classification model predictions using Amazon SageMaker Clarify

by admin
January 27, 2023
Artificial Intelligence

Human Resource Management Challenges and The Role of Artificial Intelligence in 2023 | by Ghulam Mustafa Shoaib | Jan, 2023

by admin
January 27, 2023
Deep Learning

Training Neural Nets: a Hacker’s Perspective

by admin
January 27, 2023

© 2023 Machine Learning News Hubb All rights reserved.

Use of these names, logos, and brands does not imply endorsement unless specified. By using this site, you agree to the Privacy Policy and Terms & Conditions.

Navigate Site

  • Home
  • Machine Learning
  • Artificial Intelligence
  • Big Data
  • Deep Learning
  • Edge AI
  • Neural Network
  • Contact Us

Newsletter Sign Up.

No Result
View All Result
  • Home
  • Machine Learning
  • Artificial Intelligence
  • Big Data
  • Deep Learning
  • Edge AI
  • Neural Network
  • Contact Us

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.