{"id":17859,"date":"2023-07-27T12:52:13","date_gmt":"2023-07-27T12:52:13","guid":{"rendered":"https:\/\/thedatascientist.com\/?p=15865"},"modified":"2023-07-27T12:52:13","modified_gmt":"2023-07-27T12:52:13","slug":"performance-measures-the-concordance-correlation-coefficient","status":"publish","type":"post","link":"https:\/\/python-bloggers.com\/2023\/07\/performance-measures-the-concordance-correlation-coefficient\/","title":{"rendered":"Performance measures: The Concordance Correlation Coefficient"},"content":{"rendered":"<div style=\\\"border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 12px;\\\">\r\n<i>This article was first published on  <strong>\r\n<a href=\"https:\/\/thedatascientist.com\/performance-measures-cohens-kappa-statistic-2\/\"> Technical Posts Archives - TDS <\/a><\/strong>, and kindly contributed to <a href=\/about\/>python-bloggers<\/a>.  (You can report issue about the content on this page <a href=\/contact-us\/>here<\/a>)\r\n<br\/>Want to share your content on python-bloggers?<a href=\/add-your-blog\/> click here<\/a>.<\/i>\r\n<\/div>\n<p><em>Wanna become a data scientist within 3 months, and get a guaranteed job? Then you need to\u00a0<a href=\"https:\/\/beyond-machine.com\/webinar\">check this out\u00a0<\/a>!<\/em><\/p>\n<p>This post continues the series of posts on performance measures. In our previous article we talked about&nbsp;<a href=\"http:\/\/www.skampakis.com\/performance-measures-cohens-kappa-statistic\/\"  rel=\"noreferrer noopener\">Cohen\u2019s Kappa<\/a>. In this post we will talk about the&nbsp;<strong>concordance correlation coefficient<\/strong>.<\/p>\n<p>A common way to measure the performance of a regression algorithm is&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Pearson_product-moment_correlation_coefficient\"  rel=\"noreferrer noopener\">Pearson\u2019s correlation<\/a>&nbsp;between the true and the predicted values.&nbsp;However, Pearson\u2019s correlation in this case&nbsp;suffers from one drawback. It ignores any bias which might exist between the true and the predicted values. Let me give an example. The figure below shows the relationship between two variables. Variable X is sampled from the standard normal distribution and y=x+10. We can treat X as the target variable and as Y the predicted value of a statistical model.<\/p>\n<figure class=\"wp-block-pullquote has-text-align-left\" style=\"border-width:1px;font-size:18px;font-style:normal;font-weight:500\">\n<blockquote>\n<p>Trending<\/p>\n<p><cite><a href=\"https:\/\/wordpress-600595-1943234.cloudwaysapps.com\/the-positive-side-of-technology-leverage-ai-to-make-smarter-financial-business-decisions\/\">The Positive Side of Technology: Leverage AI to Make Smarter Financial Business Decisions<\/a><\/cite><\/p><\/blockquote>\n<\/figure>\n<p>The correlation between these two variables takes the value 1, so it is perfect.<a href=\"https:\/\/i0.wp.com\/www.skampakis.com\/wp-content\/uploads\/2015\/09\/perfect_correlation_with_bias.png\"><\/a><\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/thedatascientist.com\/wp-content\/uploads\/2023\/07\/perfect_correlation_with_bias.webp?resize=568%2C358&#038;ssl=1\" alt=\"\" class=\"wp-image-15872\" width=\"568\" height=\"358\" srcset=\"https:\/\/thedatascientist.com\/wp-content\/uploads\/2023\/07\/perfect_correlation_with_bias.webp 768w, https:\/\/thedatascientist.com\/wp-content\/uploads\/2023\/07\/perfect_correlation_with_bias-300x189.webp 300w\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" \/><\/figure>\n<\/div>\n<p>However, what we care about when measuring the agreement between the true and the predicted values, is whether they predict the exact same value. If that is the case, then a point is on the 45 degree line crossing the origin. This is the red line shown below. It is clear that the red line that indicates perfect agreement is parallel to the relationship between x and y.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/thedatascientist.com\/wp-content\/uploads\/2023\/07\/correlation_not_agreement.webp?resize=578%2C365&#038;ssl=1\" alt=\"\" class=\"wp-image-15874\" width=\"578\" height=\"365\" srcset=\"https:\/\/thedatascientist.com\/wp-content\/uploads\/2023\/07\/correlation_not_agreement.webp 768w, https:\/\/thedatascientist.com\/wp-content\/uploads\/2023\/07\/correlation_not_agreement-300x189.webp 300w\" sizes=\"auto, (max-width: 623px) 100vw, 623px\" \/><\/figure>\n<\/div>\n<p>So what can we do? The\u00a0<strong><a href=\"https:\/\/en.wikipedia.org\/wiki\/Concordance_correlation_coefficient\"  rel=\"noreferrer noopener\">concordance correlation coefficient<\/a><\/strong>\u00a0comes to the rescue! The concordance\u00a0<a href=\"https:\/\/wordpress-600595-1943234.cloudwaysapps.com\/metrics-matthews-correlation-coefficient\/\">correlation coefficient<\/a>\u00a0measures the agreement between two variables. In this case, the value is around 0.02,\u00a0indicating no agreement between the two variables.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/thedatascientist.com\/wp-content\/uploads\/2023\/07\/Screen-Shot-2020-09-08-at-10.51.23.webp?resize=306%2C83&#038;ssl=1\" alt=\"\" class=\"wp-image-15876\" width=\"306\" height=\"83\" srcset=\"https:\/\/thedatascientist.com\/wp-content\/uploads\/2023\/07\/Screen-Shot-2020-09-08-at-10.51.23.webp 518w, https:\/\/thedatascientist.com\/wp-content\/uploads\/2023\/07\/Screen-Shot-2020-09-08-at-10.51.23-300x81.webp 300w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/><\/figure>\n<\/div>\n<p>Unfortunately, the concordance correlation coefficient is not widely used in the evaluation of predictive models. I believe this to be an important omission and I would urge any\u00a0<a href=\"https:\/\/wordpress-600595-1943234.cloudwaysapps.com\/the-data-scientist-2021-survey\/\">data scientist<\/a>\u00a0to start using it for regression modelling.<\/p>\n<p>You can use it in R by downloading the package\u00a0<a href=\"https:\/\/cran.r-project.org\/web\/packages\/epiR\/index.html\"  rel=\"noreferrer noopener\">epiR<\/a>.<\/p>\n<p>So,&nbsp;next time you run a regression model use both Pearson\u2019s correlation coefficient and the concordance correlation coefficient and check the difference between them. You\u2019ll see that the concordance correlation coefficient is usually more conservative and has a lower value&nbsp;than Pearson\u2019s correlation coefficient. However, it can be a safer measure to use for measuring performance in regression, in order to avoid these few cases where strong bias in the predictions might be an issue.<\/p>\n<p>Also, make sure to check some of my other posts about\u00a0<a href=\"https:\/\/wordpress-600595-1943234.cloudwaysapps.com\/performance-measures-predictive-modelling\/\"  rel=\"noreferrer noopener\">performance measures in predictive modelling<\/a>\u00a0and\u00a0<a href=\"https:\/\/wordpress-600595-1943234.cloudwaysapps.com\/performance-measures-cohens-kappa-statistic\/\">Cohen\u2019s Kappa<\/a>.<\/p>\n<p><em>Wanna become a data scientist within 3 months, and get a guaranteed job? Then you need to\u00a0<a href=\"https:\/\/beyond-machine.com\/webinar\">check this out\u00a0<\/a>!<\/em><\/p>\n<div class=\"wp-block-columns is-layout-flex wp-container-19\">\n<div class=\"wp-block-column is-layout-flow\">\n<p class=\"has-nv-light-bg-background-color has-background\">The Positive Side of Technology: Leverage AI to Make Smarter Financial Business Decisions<\/p>\n<\/div>\n<div class=\"wp-block-column is-layout-flow\">\n<p class=\"has-nv-light-bg-background-color has-background\">Power Skiving for Smaller Precise Robotics Machining<\/p>\n<\/div>\n<\/div>\n<div class=\"wp-block-columns is-layout-flex wp-container-22\">\n<div class=\"wp-block-column is-layout-flow\">\n<p class=\"has-nv-light-bg-background-color has-background\">Unraveling the Key Techniques and Best Practices of Regression Testing for Ensuring Long-Term Quality Assurance<\/p>\n<\/div>\n<div class=\"wp-block-column is-layout-flow\">\n<p class=\"has-nv-light-bg-background-color has-background\">Unleashing the Power of ChatGPT: Revolutizing Communication and Streamlining Workflows<\/p>\n<\/div>\n<\/div>\n\n<div style=\\\"border: 1px solid; background: none repeat scroll 0 0 #EDEDED; margin: 1px; font-size: 13px;\\\">\r\n<div style=\\\"text-align: center;\\\">To <strong>leave a comment<\/strong> for the author, please follow the link and comment on their blog: <strong><a href=\"https:\/\/thedatascientist.com\/performance-measures-cohens-kappa-statistic-2\/\"> Technical Posts Archives - TDS <\/a><\/strong>.<\/div>\r\n<hr \/>\r\nWant to share your content on python-bloggers?<a href=\/add-your-blog\/ rel=\\\"nofollow\\\"> click here<\/a>.\r\n<\/div>","protected":false},"excerpt":{"rendered":"<div style = \"width: 60%; display: inline-block; float:left; \"> Wanna become a data scientist within 3 months, and get a guaranteed job? Then you need to\u00a0check this out\u00a0! This post continues the series of posts on performance measures. In our previous article we talked about\u00a0Cohen\u2019s Kappa. In this post we will talk about the\u00a0concordance correlation coefficient. &#8230;<\/div>\n<div style = \"width: 40%; display: inline-block; float:right;\"><img id=\"excerpts_images\" src=' https:\/\/thedatascientist.com\/wp-content\/uploads\/2023\/07\/perfect_correlation_with_bias.webp' width = \"200\"  style = \"padding: 10px;\" \/><\/div>\n<div style=\"clear: both;\"><\/div>\n","protected":false},"author":95,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-17859","post","type-post","status-publish","format-standard","hentry","category-data-science"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/python-bloggers.com\/wp-json\/wp\/v2\/posts\/17859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/python-bloggers.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/python-bloggers.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/python-bloggers.com\/wp-json\/wp\/v2\/users\/95"}],"replies":[{"embeddable":true,"href":"https:\/\/python-bloggers.com\/wp-json\/wp\/v2\/comments?post=17859"}],"version-history":[{"count":1,"href":"https:\/\/python-bloggers.com\/wp-json\/wp\/v2\/posts\/17859\/revisions"}],"predecessor-version":[{"id":17860,"href":"https:\/\/python-bloggers.com\/wp-json\/wp\/v2\/posts\/17859\/revisions\/17860"}],"wp:attachment":[{"href":"https:\/\/python-bloggers.com\/wp-json\/wp\/v2\/media?parent=17859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/python-bloggers.com\/wp-json\/wp\/v2\/categories?post=17859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/python-bloggers.com\/wp-json\/wp\/v2\/tags?post=17859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}