Get Started
Email hello@westlink.com Phone (866) 954-6533
(Opens in a new tab) LinkedIn
Blog / Machine Learning, Machine Learning Explained / Matthews Correlation Coefficient: Machine Learning Explained

Matthews Correlation Coefficient: Machine Learning Explained

Apr. 4, 2024
10 min
Nathan Robinson
Nathan Robinson
Product Owner
Nathan is a product leader with proven success in defining and building B2B, B2C, and B2B2C mobile, web, and wearable products. These products are used by millions and available in numerous languages and countries. Following his time at IBM Watson, he 's focused on developing products that leverage artificial intelligence and machine learning, earning accolades such as Forbes' Tech to Watch and TechCrunch's Top AI Products.

The Matthews Correlation Coefficient (MCC), named after biochemist Brian W. Matthews, is a statistical measure used in machine learning and artificial intelligence to evaluate the quality of binary classifications. It is a highly reliable metric that provides a balanced measure even when the classes are of very different sizes. The MCC is essentially a correlation coefficient between the observed and predicted binary classifications; it returns a value between -1 and +1. A coefficient of +1 represents a perfect prediction, 0 an average random prediction and -1 an inverse prediction.

The MCC is particularly useful in the field of artificial intelligence, where it is often used to evaluate the performance of algorithms. It is considered more robust than other metrics such as accuracy, precision, recall, and F1 score, especially in situations where the data set is imbalanced. This is because the MCC takes into account true and false positives and negatives, providing a more holistic view of the algorithm’s performance.

Understanding the Matthews Correlation Coefficient

The Matthews Correlation Coefficient is calculated using a confusion matrix, which is a specific table layout that allows visualization of the performance of an algorithm. Each row of the matrix represents the instances in a predicted class, while each column represents the instances in an actual class. The MCC is calculated using the values in this matrix: true positives (TP), true negatives (TN), false positives (FP), and false negatives (FN).

The formula for calculating the MCC is as follows:

This formula essentially measures the correlation between the observed and predicted binary classifications. The result is a single number that encapsulates the performance of the algorithm in terms of its binary classifications.

Interpreting the Matthews Correlation Coefficient

The value of the MCC can be interpreted as follows: A coefficient of +1 represents a perfect prediction, 0 an average random prediction and -1 an inverse prediction. This makes it a very intuitive metric to understand. For example, if an algorithm has an MCC of 0.7, it means that it is performing significantly better than random chance, but is not perfect.

It’s also important to note that the MCC is a balanced measure. This means that it gives equal weight to all four values in the confusion matrix (TP, TN, FP, FN). This makes it a particularly useful metric in situations where the data set is imbalanced, as it won’t be skewed by the larger class.

Advantages of the Matthews Correlation Coefficient

One of the main advantages of the MCC is that it is a balanced measure. This means that it is not influenced by the prevalence of the classes, making it a reliable metric even when the classes are of very different sizes. This is a significant advantage over other metrics such as accuracy, which can be misleading in situations where the data set is imbalanced.

The MCC also takes into account both the positive and negative contributions of the algorithm’s predictions. This makes it a more holistic measure than metrics such as precision and recall, which only consider the positive contributions. As such, the MCC can provide a more complete picture of the algorithm’s performance.

Application of Matthews Correlation Coefficient in Artificial Intelligence

The Matthews Correlation Coefficient is widely used in the field of artificial intelligence to evaluate the performance of algorithms. It is particularly useful in situations where the data set is imbalanced, as it provides a balanced measure of the algorithm’s performance.

For example, in a binary classification problem where the positive class is much smaller than the negative class, the MCC can provide a more accurate measure of the algorithm’s performance than metrics such as accuracy, precision, recall, and F1 score. This is because the MCC takes into account both the positive and negative contributions of the algorithm’s predictions, providing a more holistic view of its performance.

Use in Machine Learning

In machine learning, the MCC is often used to evaluate the performance of binary classification algorithms. This includes algorithms such as logistic regression, decision trees, and support vector machines. The MCC provides a single, easy-to-understand number that encapsulates the performance of the algorithm in terms of its binary classifications.

The MCC is particularly useful in situations where the data set is imbalanced. In these situations, metrics such as accuracy can be misleading, as they can be skewed by the larger class. The MCC, on the other hand, is a balanced measure that gives equal weight to all four values in the confusion matrix (TP, TN, FP, FN), making it a more reliable metric.

Use in Deep Learning

The MCC is also used in deep learning, a subfield of machine learning that focuses on algorithms that can learn from and make decisions based on data representations, as opposed to task-specific algorithms. In deep learning, the MCC can be used to evaluate the performance of binary classification algorithms such as convolutional neural networks (CNNs) and recurrent neural networks (RNNs).

As with machine learning, the MCC is particularly useful in situations where the data set is imbalanced. It provides a balanced measure of the algorithm’s performance, taking into account both the positive and negative contributions of its predictions. This makes it a more reliable metric than others such as accuracy, precision, recall, and F1 score, especially in situations where the data set is imbalanced.

Limitations of the Matthews Correlation Coefficient

While the MCC is a highly reliable metric, it is not without its limitations. One of the main limitations is that it is only applicable to binary classification problems. This means that it cannot be used to evaluate the performance of multi-class classification algorithms.

Another limitation is that the MCC can be difficult to interpret in some situations. While a coefficient of +1 represents a perfect prediction, 0 an average random prediction and -1 an inverse prediction, values in between can be less intuitive. For example, it can be difficult to intuitively understand the difference between an MCC of 0.3 and 0.4.

Difficulty in Interpretation

As mentioned above, one of the main limitations of the MCC is that it can be difficult to interpret in some situations. While the extremes of the scale (+1, 0, -1) are easy to understand, values in between can be less intuitive. This can make it difficult to use the MCC as a standalone metric, especially in situations where a more nuanced understanding of the algorithm’s performance is required.

For example, consider a situation where an algorithm has an MCC of 0.3. While this indicates that the algorithm is performing better than random chance, it doesn’t provide a clear indication of how much better it is performing. In these situations, it can be helpful to use the MCC in conjunction with other metrics to get a more complete picture of the algorithm’s performance.

Applicability to Binary Classifications Only

Another limitation of the MCC is that it is only applicable to binary classification problems. This means that it cannot be used to evaluate the performance of multi-class classification algorithms. In these situations, other metrics such as the multi-class confusion matrix or the one-vs-all approach may be more appropriate.

Despite this limitation, the MCC remains a highly useful metric in the field of artificial intelligence. Its ability to provide a balanced measure of an algorithm’s performance, even in situations where the data set is imbalanced, makes it a valuable tool for evaluating the performance of binary classification algorithms.

Conclusion

The Matthews Correlation Coefficient is a highly reliable metric used in the field of artificial intelligence to evaluate the performance of binary classification algorithms. It provides a balanced measure of the algorithm’s performance, taking into account both the positive and negative contributions of its predictions. This makes it a particularly useful metric in situations where the data set is imbalanced.

While the MCC has its limitations, including its applicability only to binary classification problems and its potential difficulty in interpretation, it remains a valuable tool in the field of artificial intelligence. By providing a single, easy-to-understand number that encapsulates the performance of an algorithm in terms of its binary classifications, the MCC can provide a more complete picture of an algorithm’s performance than other metrics.

Nathan Robinson
Nathan Robinson
Product Owner
Nathan is a product leader with proven success in defining and building B2B, B2C, and B2B2C mobile, web, and wearable products. These products are used by millions and available in numerous languages and countries. Following his time at IBM Watson, he 's focused on developing products that leverage artificial intelligence and machine learning, earning accolades such as Forbes' Tech to Watch and TechCrunch's Top AI Products.

Comments

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments