You are currently viewing Machine Learning Metrics – Performance Metrics

Machine Learning Metrics – Performance Metrics

Machine Learning Metrics measure the performance of Machine Learning Algorithms. These are also known as performance metrics used to evaluate machine learning algorithms. Machine Learning Metrics help us to understand

  • How good is the algorithm for the given dataset
  • How accurate and correct results can be obtained
  • Performance of algorithm on unknown data
  • Crucial insights about the algorithm

In short, Machine Learning Metrics are the report card of Machine Learning Algorithms.

Types of Machine Learning Metrics

Choice of Machine Learning Metrics depends upon the type of Machine Learning algorithms used. For classification algorithms, classification metrics are used and for regression algorithms, regression metrics are used.

Classification Metrics

There are several Classification Metrics as shown below

Classification machine learning metrics

Confusion Matrix

The name is confusing but when a confusion matrix is studied it becomes really easy to understand. This is just a 2*2 matrix confusion matrix depending upon the classes we have in the classification problem.
It is the simplest way to measure the performance of a classification problem where the output can be of two or more types of classes. A confusion matrix is nothing but a table with two dimensions viz. “Actual” and “Predicted” and furthermore, both the dimensions have “True Positives (TP)”, “True Negatives (TN)”, “False Positives (FP)”, and “False Negatives (FN)” as shown below −

Confusion matrix machine learning metric

True Positives (TP) − It is the case when both the actual class & predicted class of the data point is 1.

True Negatives (TN) − It is the case when both the actual class & predicted class of the data point is 0.

False Positives (FP) − It is the case when an actual class of data point is 0 & predicted class of data point is 1.

False Negatives (FN) − It is the case when an actual class of data point is 1 & predicted class of data point is 0.

NOTE: Confusion Matrix can be used for binary as well as multi-classification problems.
A practical example to better understand the confusion matrix.

Accuracy

Accuracy is the most common performance metric for classification algorithms. Accuracy measures the total number of correct predictions made by the algorithm. It may be explained as the number of right predictions made as a ratio of all predictions made. You can easily calculate it simply by using the confusion matrix the formula is given by-

Accuracy machine learning metric

Precision

Precision is the proportion of correct positive predictions. It is given by the following formula-

Precision machine learning metric

Recall

The measure of identifying True Positives. Recall metric is useful when you want to know the real performance of the algorithm. It is knowing where the algorithm missed in making correct predictions. Recall also tells about the wrong predictions made by our classification algorithms. The recall is widely used in the hospitality, and healthcare sectors.
For Example, Doctors would want to know how many patients were not detected to have cancer but in reality, they had cancer.

Recall classification metric

F1-Score

It is the harmonic mean of the precision and recall of a classifier. The formula is given below:

F1- Score machine learning metrics

Classification Report

A classification report gives a complete evaluation report of the classification algorithm. It includes precision, recall, F1-Score, and Support.

Thus the choice of classification metrics depends upon the data set, based on the requirement we can choose the evaluation metrics. Based on the results we can improve the performance of the algorithm too.

In the next blog, we shall cover Regression Metrics in detail, I just providing a brief of regression metrics below.

Regression Metrics

There are several types of Regression Metrics

  • Mean Absolute Error (MAE)
  • Mean Squared Error (MSE)
  • Root Mean Squared Error (RMSE)
  • R-Square (R^2)
  • Mean Absolute Percentage Error (MAPE)
  • Mean Percentage Error (MPE)

In case you would like to learn more about the regression metrics refer to the tutorial.

This Post Has One Comment

Leave a Reply