{"id":6438,"date":"2026-04-25T15:31:46","date_gmt":"2026-04-25T20:31:46","guid":{"rendered":"https:\/\/ykim.synology.me\/wordpress\/?p=6438"},"modified":"2026-04-26T10:59:10","modified_gmt":"2026-04-26T15:59:10","slug":"centered-r%c2%b2-vs-uncentered-r%c2%b2","status":"publish","type":"post","link":"https:\/\/ykim.synology.me\/wordpress\/centered-r%c2%b2-vs-uncentered-r%c2%b2-6438\/","title":{"rendered":"Centered R\u00b2 vs Uncentered R\u00b2"},"content":{"rendered":"<style>.kadence-column6438_2837c0-ae > .kt-inside-inner-col{display:flex;}.kadence-column6438_2837c0-ae > .kt-inside-inner-col,.kadence-column6438_2837c0-ae > .kt-inside-inner-col:before{border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;}.kadence-column6438_2837c0-ae > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column6438_2837c0-ae > .kt-inside-inner-col{flex-direction:row;flex-wrap:wrap;align-items:flex-end;}.kadence-column6438_2837c0-ae > .kt-inside-inner-col > *, .kadence-column6438_2837c0-ae > .kt-inside-inner-col > figure.wp-block-image, .kadence-column6438_2837c0-ae > .kt-inside-inner-col > figure.wp-block-kadence-image{margin-top:0px;margin-bottom:0px;}.kadence-column6438_2837c0-ae > .kt-inside-inner-col > .kb-image-is-ratio-size{flex-grow:1;}.kt-row-column-wrap > .kadence-column6438_2837c0-ae{align-self:flex-end;}.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column6438_2837c0-ae{align-self:auto;}.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column6438_2837c0-ae > .kt-inside-inner-col{align-items:flex-end;}.kadence-column6438_2837c0-ae > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column6438_2837c0-ae{position:relative;}@media all and (max-width: 1024px){.kt-row-column-wrap > .kadence-column6438_2837c0-ae{align-self:flex-end;}}@media all and (max-width: 1024px){.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column6438_2837c0-ae{align-self:auto;}}@media all and (max-width: 1024px){.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column6438_2837c0-ae > .kt-inside-inner-col{align-items:flex-end;}}@media all and (max-width: 1024px){.kadence-column6438_2837c0-ae > .kt-inside-inner-col{flex-direction:row;flex-wrap:wrap;align-items:flex-end;}}@media all and (min-width: 768px) and (max-width: 1024px){.kadence-column6438_2837c0-ae > .kt-inside-inner-col > *, .kadence-column6438_2837c0-ae > .kt-inside-inner-col > figure.wp-block-image, .kadence-column6438_2837c0-ae > .kt-inside-inner-col > figure.wp-block-kadence-image{margin-top:0px;margin-bottom:0px;}.kadence-column6438_2837c0-ae > .kt-inside-inner-col > .kb-image-is-ratio-size{flex-grow:1;}}@media all and (max-width: 767px){.kt-row-column-wrap > .kadence-column6438_2837c0-ae{align-self:flex-end;}.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column6438_2837c0-ae{align-self:auto;}.kt-inner-column-height-full:not(.kt-has-1-columns) > .wp-block-kadence-column.kadence-column6438_2837c0-ae > .kt-inside-inner-col{align-items:flex-end;}.kadence-column6438_2837c0-ae > .kt-inside-inner-col{flex-direction:row;flex-wrap:wrap;justify-content:flex-start;}.kadence-column6438_2837c0-ae > .kt-inside-inner-col > *, .kadence-column6438_2837c0-ae > .kt-inside-inner-col > figure.wp-block-image, .kadence-column6438_2837c0-ae > .kt-inside-inner-col > figure.wp-block-kadence-image{margin-top:0px;margin-bottom:0px;}.kadence-column6438_2837c0-ae > .kt-inside-inner-col > .kb-image-is-ratio-size{flex-grow:1;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column6438_2837c0-ae kb-section-dir-horizontal\"><div class=\"kt-inside-inner-col\">\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"765\" height=\"574\" src=\"https:\/\/ykim.synology.me\/wordpress\/wp-content\/uploads\/2026\/04\/Bondi-Icebergs-pool-765x574px.png\" alt=\"\" class=\"wp-image-6439\" style=\"width:600px\" srcset=\"https:\/\/ykim.synology.me\/wordpress\/wp-content\/uploads\/2026\/04\/Bondi-Icebergs-pool-765x574px.png 765w, https:\/\/ykim.synology.me\/wordpress\/wp-content\/uploads\/2026\/04\/Bondi-Icebergs-pool-765x574px-300x225.png 300w\" sizes=\"auto, (max-width: 765px) 100vw, 765px\" \/><\/figure>\n\n\n\n<p class=\"has-theme-palette-6-color has-text-color has-link-color wp-elements-6e690834eaf3cc362be686789915620d wp-block-paragraph\" style=\"font-size:8px\">Bondi Iceberg pool<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">1. Introduction: R\u00b2 and Its Relation to RSQ<\/h2>\n\n\n<style>.kadence-column6438_08ba48-76 > .kt-inside-inner-col{padding-left:var(--global-kb-spacing-sm, 1.5rem);}.kadence-column6438_08ba48-76 > .kt-inside-inner-col,.kadence-column6438_08ba48-76 > .kt-inside-inner-col:before{border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;}.kadence-column6438_08ba48-76 > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column6438_08ba48-76 > .kt-inside-inner-col{flex-direction:column;}.kadence-column6438_08ba48-76 > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column6438_08ba48-76 > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column6438_08ba48-76{position:relative;}@media all and (max-width: 1024px){.kadence-column6438_08ba48-76 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column6438_08ba48-76 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column6438_08ba48-76\"><div class=\"kt-inside-inner-col\">\n<p class=\"wp-block-paragraph\">The coefficient of determination, denoted as R\u00b2 (R-squared), is one of the most widely used validation metrics in statistics and machine learning (ML) for assessing how well predicted values $\\hat{y}$ agree with observed values $y_{true}$. In spreadsheet software and many engineering reports, R\u00b2 is often referred to as <strong>RSQ<\/strong> (the Excel function name <code>RSQ()<\/code>), which computes the squared Pearson correlation coefficient between two variables. The default RSQ in Excel and the standard R\u00b2 reported by most regression libraries refer to the same quantity: the <strong>centered R\u00b2<\/strong>, which measures the proportion of variance in $y$ explained by the model relative to its mean baseline.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, a less commonly discussed variant \u2014 the <strong>uncentered R\u00b2<\/strong> \u2014 replaces the mean-based baseline with a zero baseline. This article compares the two, derives the uncentered formula, provides a geometric interpretation, and discusses when each is appropriate. In particular, we examine whether uncentered R\u00b2 is more suitable for evaluating 1:1-line agreement between $y_{true}$ and $\\hat{y}$ in same-physical-quantity comparisons (Kvalseth 1985; Legates &amp; McCabe 1999).<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">2. Comparison of the Two Formulas<\/h2>\n\n\n<style>.kadence-column6438_9468e9-1c > .kt-inside-inner-col{padding-left:var(--global-kb-spacing-sm, 1.5rem);}.kadence-column6438_9468e9-1c > .kt-inside-inner-col,.kadence-column6438_9468e9-1c > .kt-inside-inner-col:before{border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;}.kadence-column6438_9468e9-1c > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column6438_9468e9-1c > .kt-inside-inner-col{flex-direction:column;}.kadence-column6438_9468e9-1c > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column6438_9468e9-1c > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column6438_9468e9-1c{position:relative;}@media all and (max-width: 1024px){.kadence-column6438_9468e9-1c > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column6438_9468e9-1c > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column6438_9468e9-1c\"><div class=\"kt-inside-inner-col\">\n<div style=\"background-color: #fff; border: none\">\n$$R^2_c = 1 &#8211; \\frac{\\sum_{i=1}^n (y_i &#8211; \\hat{y}_i)^2}{\\sum_{i=1}^n (y_i &#8211; \\bar{y})^2}$$\n<\/div>\n\n\n\n<div style=\"background-color: #fff; border: none\">\n$$R^2_u = 1 &#8211; \\frac{\\sum_{i=1}^n (y_i &#8211; \\hat{y}_i)^2}{\\sum_{i=1}^n y_i^2}$$\n<\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The difference lies entirely in the denominator. Centered R\u00b2 asks &#8220;how much variance around the mean has been explained?&#8221;, whereas uncentered R\u00b2 asks &#8220;how much of the total sum of squares around zero has been explained?&#8221;. Centered R\u00b2 uses the mean prediction as its baseline, while uncentered R\u00b2 uses zero prediction as its baseline (Kvalseth 1985).<\/li>\n\n\n\n<li><mark style=\"background-color:rgba(0, 0, 0, 0);color:#001eff\" class=\"has-inline-color\">Centered R\u00b2 asks: &#8220;How much better is the model compared to a baseline that simply predicts the mean?&#8221;<br>Uncentered R\u00b2 asks: &#8220;How close is the model&#8217;s prediction to the 1:1 identity line (y=x)?&#8221;<\/mark><\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">3. Pros and Cons<\/h2>\n\n\n<style>.kadence-column6438_a125be-79 > .kt-inside-inner-col{padding-left:var(--global-kb-spacing-sm, 1.5rem);}.kadence-column6438_a125be-79 > .kt-inside-inner-col,.kadence-column6438_a125be-79 > .kt-inside-inner-col:before{border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;}.kadence-column6438_a125be-79 > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column6438_a125be-79 > .kt-inside-inner-col{flex-direction:column;}.kadence-column6438_a125be-79 > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column6438_a125be-79 > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column6438_a125be-79{position:relative;}@media all and (max-width: 1024px){.kadence-column6438_a125be-79 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column6438_a125be-79 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column6438_a125be-79\"><div class=\"kt-inside-inner-col\">\n<h3 class=\"wp-block-heading\">Centered R\u00b2<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Pros<\/strong>: Scale- and unit-invariant, allowing comparison of models across different physical quantities. Equivalent to the squared Pearson correlation coefficient, providing rich statistical intuition.<\/li>\n\n\n\n<li><strong>Cons<\/strong>: <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-theme-palette-13-color\">When the variance of $y$ is small (nearly constant), the denominator approaches zero and R\u00b2 collapses or even turns negative<\/mark>. Measures only relative performance against a mean predictor and is insensitive to systematic bias.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Uncentered R\u00b2<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Pros<\/strong>: When comparing models, datasets, or experiments at the same physical-quantity level, uncentered R\u00b2 provides a consistent absolute baseline (zero prediction), enabling coherent cross-comparison. Robust against low-variance data. Sensitive to deviations from the 1:1 line, properly penalizing systematic bias (Legates &amp; McCabe 1999).<\/li>\n\n\n\n<li><strong>Cons<\/strong>: <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-theme-palette-13-color\">Scale-dependent, so unsuitable for comparing models across different units or value ranges<\/mark>. When $\\bar{y}$ is large, $R^2_u$ tends to be artificially close to 1. Uncentered $R^2$ values tend to be significantly higher (often reaching 0.99 or above) because the denominator, $\\sum y_i^2$, is generally much larger than the centered denominator, $\\sum (y_i &#8211; \\bar{y})^2$. This can lead to an overly optimistic assessment if interpreted in isolation.  <mark style=\"background-color:rgba(0, 0, 0, 0);color:#0004ff\" class=\"has-inline-color\"><strong>However, for min-max normalized data, the uniformity of scale renders the uncentered $R^2$ a superior metric for quantifying the absolute agreement between observed and predicted values<\/strong>.<\/mark><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Key question<\/strong>: When comparing models on data of the same physical quantity, is uncentered R\u00b2 actually more accurate? The answer is essentially &#8220;yes.&#8221; For evaluating absolute agreement between $y_{true}$ and $\\hat{y}$ in same-unit data, uncentered R\u00b2 (1) is not distorted by changes in dataset variance, (2) is sensitive to constant bias, and (3) shares an absolute baseline (zero prediction) across datasets, enabling consistent model-to-model comparison.<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">4. Applications<\/h2>\n\n\n<style>.kadence-column6438_1bbedf-cb > .kt-inside-inner-col{padding-left:var(--global-kb-spacing-sm, 1.5rem);}.kadence-column6438_1bbedf-cb > .kt-inside-inner-col,.kadence-column6438_1bbedf-cb > .kt-inside-inner-col:before{border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;}.kadence-column6438_1bbedf-cb > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column6438_1bbedf-cb > .kt-inside-inner-col{flex-direction:column;}.kadence-column6438_1bbedf-cb > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column6438_1bbedf-cb > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column6438_1bbedf-cb{position:relative;}@media all and (max-width: 1024px){.kadence-column6438_1bbedf-cb > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column6438_1bbedf-cb > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column6438_1bbedf-cb\"><div class=\"kt-inside-inner-col\">\n<h3 class=\"wp-block-heading\">Centered R\u00b2<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Standard performance metric in general regression and ML modeling.<\/li>\n\n\n\n<li>Comparing model performance across heterogeneous units or domains in normalized form.<\/li>\n\n\n\n<li>Variance-explanation evaluation based on Pearson correlation (Draper &amp; Smith 1998).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Uncentered R\u00b2<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Regression Through the Origin (RTO)<\/strong>: Models physically constrained to pass through zero, such as Hooke&#8217;s law and radioactive decay. The <code>noconstant<\/code> option in Stata, R, and EViews automatically returns uncentered R\u00b2 (Eisenhauer 2003). <mark style=\"background-color:rgba(0, 0, 0, 0);color:#001eff\" class=\"has-inline-color\">When the intercept is fixed to zero, standard (centered) $R^2$ can produce negative values or misleading interpretations. In such cases, Uncentered $R^2$ is used as a robust alternative to evaluate the model&#8217;s fit relative to the origin.<\/mark><\/li>\n\n\n\n<li><strong>Diagnostic tests in econometrics<\/strong>: Auxiliary regressions in the Breusch-Pagan and White tests use $nR^2$ as a chi-squared statistic, computed in uncentered form (Wooldridge 2010).<\/li>\n\n\n\n<li><strong>Evaluating deviation from the 1:1 line in $Y_{true}$ vs $Y_{pred}$ plots<\/strong>: For ML prediction tasks involving same-physical-quantity data, uncentered R\u00b2 measures absolute agreement. Suitable for calibration, Computational Fluid Dynamics (CFD) and Finite Element Method (FEM) validation, sensor calibration, and reproducibility studies.<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">5. Derivation of Uncentered R\u00b2<\/h2>\n\n\n<style>.kadence-column6438_ac2573-78 > .kt-inside-inner-col{padding-left:var(--global-kb-spacing-sm, 1.5rem);}.kadence-column6438_ac2573-78 > .kt-inside-inner-col,.kadence-column6438_ac2573-78 > .kt-inside-inner-col:before{border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;}.kadence-column6438_ac2573-78 > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column6438_ac2573-78 > .kt-inside-inner-col{flex-direction:column;}.kadence-column6438_ac2573-78 > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column6438_ac2573-78 > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column6438_ac2573-78{position:relative;}@media all and (max-width: 1024px){.kadence-column6438_ac2573-78 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column6438_ac2573-78 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column6438_ac2573-78\"><div class=\"kt-inside-inner-col\">\n<h3 class=\"wp-block-heading\">Sum of Squares Decomposition<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For observations $y_i$, predictions $\\hat{y}_i$, and residuals $e_i = y_i &#8211; \\hat{y}_i$ ($i = 1, \\ldots, n$), define the uncentered sums of squares \u2014 Total Sum of Squares (TSS), Explained Sum of Squares (ESS), and Residual Sum of Squares (RSS) \u2014 as follows:<\/p>\n\n\n\n<div style=\"background-color: #fff; border: none\">\n$$TSS_u = \\sum_{i=1}^n y_i^2, \\quad ESS_u = \\sum_{i=1}^n \\hat{y}_i^2, \\quad RSS = \\sum_{i=1}^n e_i^2$$\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Ordinary Least Squares (OLS) Orthogonality Condition<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">From the OLS normal equations $X^T(y &#8211; X\\hat{\\beta}) = 0$, every column of the design matrix $X$ is orthogonal to the residual vector $e$:<\/p>\n\n\n\n<div style=\"background-color: #fff; border: none\">\n$$\\sum_{i=1}^n \\hat{y}_i \\cdot e_i = \\hat{\\beta}^T X^T e = 0$$\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The fitted-value vector and the residual vector are orthogonal. This holds regardless of whether the model includes an intercept.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Uncentered Decomposition<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Squaring $y_i = \\hat{y}_i + e_i$ and summing over $i$:<\/p>\n\n\n\n<div style=\"background-color: #fff; border: none\">\n$$\\sum y_i^2 = \\sum \\hat{y}_i^2 + 2\\sum \\hat{y}_i e_i + \\sum e_i^2$$\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The cross term vanishes by orthogonality $\\sum \\hat{y}_i e_i = 0$, leaving:<\/p>\n\n\n\n<div style=\"background-color: #fff; border: none\">\n$$\\sum y_i^2 = \\sum \\hat{y}_i^2 + \\sum e_i^2 \\quad \\Longleftrightarrow \\quad TSS_u = ESS_u + RSS$$\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Definition of Uncentered R\u00b2<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Dividing both sides by $TSS_u$ gives $1 = ESS_u\/TSS_u + RSS\/TSS_u$, and uncentered R\u00b2 is defined as the explained ratio:<\/p>\n\n\n\n<div style=\"background-color: #fff; border: none\">\n$$R^2_u \\equiv \\frac{ESS_u}{TSS_u} = \\frac{\\sum \\hat{y}_i^2}{\\sum y_i^2} = 1 &#8211; \\frac{\\sum(y_i &#8211; \\hat{y}_i)^2}{\\sum y_i^2}$$\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Relation to Centered R\u00b2<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Since $\\sum y_i^2 = \\sum (y_i &#8211; \\bar{y})^2 + n\\bar{y}^2$, we have $TSS_u = TSS_c + n\\bar{y}^2$. For an intercept-included model:<\/p>\n\n\n\n<div style=\"background-color: #fff; border: none\">\n$$R^2_u = \\frac{TSS_c \\cdot R^2_c + n\\bar{y}^2}{TSS_c + n\\bar{y}^2}$$\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">When $\\bar{y}$ is large or $n$ is large, $R^2_u$ moves closer to 1 than $R^2_c$. When $\\bar{y} = 0$, the two coincide.<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">6. Geometric Interpretation<\/h2>\n\n\n<style>.kadence-column6438_999b20-4f > .kt-inside-inner-col{padding-left:var(--global-kb-spacing-sm, 1.5rem);}.kadence-column6438_999b20-4f > .kt-inside-inner-col,.kadence-column6438_999b20-4f > .kt-inside-inner-col:before{border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;}.kadence-column6438_999b20-4f > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column6438_999b20-4f > .kt-inside-inner-col{flex-direction:column;}.kadence-column6438_999b20-4f > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column6438_999b20-4f > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column6438_999b20-4f{position:relative;}@media all and (max-width: 1024px){.kadence-column6438_999b20-4f > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column6438_999b20-4f > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column6438_999b20-4f\"><div class=\"kt-inside-inner-col\">\n<h3 class=\"wp-block-heading\">Vector Space Setup<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Treating the $n$ observations as vectors $\\mathbf{y}, \\hat{\\mathbf{y}}, \\mathbf{e} = \\mathbf{y} &#8211; \\hat{\\mathbf{y}} \\in \\mathbb{R}^n$, every sum of squares becomes a squared norm: $\\sum y_i^2 = \\|\\mathbf{y}\\|^2$, $\\sum \\hat{y}_i^2 = \\|\\hat{\\mathbf{y}}\\|^2$, $\\sum e_i^2 = \\|\\mathbf{e}\\|^2$.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">OLS as Orthogonal Projection<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Let $\\mathcal{C}(X)$ denote the column space of the design matrix $X$. The OLS estimate is $\\hat{\\mathbf{y}} = P_X \\mathbf{y}$ with $P_X = X(X^TX)^{-1}X^T$, the orthogonal projection of $\\mathbf{y}$ onto $\\mathcal{C}(X)$. The residual $\\mathbf{e}$ lies in the orthogonal complement, automatically satisfying $\\mathbf{e} \\perp \\hat{\\mathbf{y}}$ (Strang 2009).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Uncentered Decomposition as the Pythagorean Theorem<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Since $\\mathbf{y} = \\hat{\\mathbf{y}} + \\mathbf{e}$ and $\\hat{\\mathbf{y}} \\perp \\mathbf{e}$, a right triangle is formed:<\/p>\n\n\n\n<pre style=\"font-family: monospace; white-space: pre; line-height:1.2; background-color: #fff; border: none\">              y\n             \/|\n            \/ |\n           \/  |  e  (perpendicular residual)\n          \/   |\n         \/____|\n      origin  \u0177  (on the C(X) plane)<\/pre>\n\n\n\n<div style=\"background-color: #fff; border: none\">\n$$\\|\\mathbf{y}\\|^2 = \\|\\hat{\\mathbf{y}}\\|^2 + \\|\\mathbf{e}\\|^2$$\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">This is the geometric identity behind $TSS_u = ESS_u + RSS$ \u2014 not merely an algebraic identity, but literally the Pythagorean theorem. The geometric meaning of uncentered R\u00b2 becomes:<\/p>\n\n\n\n<div style=\"background-color: #fff; border: none\">\n$$R^2_u = \\frac{\\|\\hat{\\mathbf{y}}\\|^2}{\\|\\mathbf{y}\\|^2} = \\cos^2\\theta_u$$\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">where $\\theta_u$ is the angle between $\\mathbf{y}$ and $\\hat{\\mathbf{y}}$ measured from the origin. $R^2_u \\to 1$ means the two vectors point in the same direction; $R^2_u \\to 0$ means they are orthogonal.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Centered R\u00b2: Subtracting the Mean Vector<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Subtracting the mean vector $\\bar{\\mathbf{y}} = \\bar{y} \\cdot \\mathbf{1}$ is geometrically equivalent to projecting onto the hyperplane $\\mathbf{1}^\\perp$, which removes the component along the constant vector $\\mathbf{1}$. When the model contains an intercept, $\\mathbf{1} \\in \\mathcal{C}(X)$, so a right triangle still forms within $\\mathbf{1}^\\perp$:<\/p>\n\n\n\n<div style=\"background-color: #fff; border: none\">\n$$R^2_c = \\frac{\\|\\tilde{\\hat{\\mathbf{y}}}\\|^2}{\\|\\tilde{\\mathbf{y}}\\|^2} = \\cos^2\\theta_c$$\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">where $\\theta_c$ is the angle between the two vectors after the mean has been removed \u2014 equivalent to the squared Pearson correlation coefficient.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Geometric Distinction Between the Two R\u00b2<\/h3>\n\n\n\n<pre style=\"font-family: monospace; white-space: pre; line-height:1.2; background-color: #fff; border: none\">              y\n             \/|\n            \/ |\n           \/  |\n          \/   | e\n         \/    |\n        \/     |\n       *------\u0177-----\u2192 (C(X) plane)\n   origin\n     \/\n    *\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 1 direction (constant vector)\n    \u0233\u00b71<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Uncentered R\u00b2<\/strong>: angle between $\\mathbf{y}$ and $\\hat{\\mathbf{y}}$ measured from the origin.<\/li>\n\n\n\n<li><strong>Centered R\u00b2<\/strong>: angle measured after shifting the reference point to $\\bar{y}\\cdot\\mathbf{1}$.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The fundamental distinction is whether the reference point is the origin or the mean vector. The same data, viewed from different reference points, yields different angles between the two vectors.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Comparison Table<\/h3>\n\n\n\n<figure style=\"margin-right:var(--wp--preset--spacing--50);margin-left:var(--wp--preset--spacing--50)\" class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Aspect<\/th><th>Uncentered<\/th><th>Centered<\/th><\/tr><\/thead><tbody><tr><td>Reference point<\/td><td>Origin 0<\/td><td>Mean vector \u0233\u00b71<\/td><\/tr><tr><td>Right triangle<\/td><td>y, \u0177, e<\/td><td>\u1ef9, \u0177\u0303, e<\/td><\/tr><tr><td>Angle interpretation<\/td><td>cos\u00b2(\u2220y\u0177)<\/td><td>cos\u00b2(\u2220\u1ef9\u0177\u0303) = r\u00b2<\/td><\/tr><tr><td>Required condition<\/td><td>e \u22a5 \u0177<\/td><td>e \u22a5 \u0177 and 1 \u2208 C(X)<\/td><\/tr><tr><td>Sensitivity to bias<\/td><td>Sensitive (origin-fixed)<\/td><td>Insensitive (mean-shift invariant)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Geometric meaning of 1:1-line validation<\/strong>: Under a constant bias $\\hat{\\mathbf{y}} = \\mathbf{y} + c\\mathbf{1}$, the uncentered angle widens but the centered angle remains unchanged. Therefore, for evaluating absolute agreement, uncentered R\u00b2 responds more sensitively.<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">7. Python Code<\/h2>\n\n\n<style>.kadence-column6438_bf7654-29 > .kt-inside-inner-col{padding-left:var(--global-kb-spacing-sm, 1.5rem);}.kadence-column6438_bf7654-29 > .kt-inside-inner-col,.kadence-column6438_bf7654-29 > .kt-inside-inner-col:before{border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;}.kadence-column6438_bf7654-29 > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column6438_bf7654-29 > .kt-inside-inner-col{flex-direction:column;}.kadence-column6438_bf7654-29 > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column6438_bf7654-29 > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column6438_bf7654-29{position:relative;}@media all and (max-width: 1024px){.kadence-column6438_bf7654-29 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column6438_bf7654-29 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column6438_bf7654-29\"><div class=\"kt-inside-inner-col\">\n<h3 class=\"wp-block-heading\">Centered R\u00b2<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#24292e;--cbp-line-number-width:calc(2 * 0.6 * 1rem);line-height:1.625rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>def centered_r2(y_true, y_pred):\n    \"\"\"\n    Centered R\u00b2 (standard R\u00b2)\n    R\u00b2_c = 1 - SSE \/ SST_centered\n    \"\"\"\n    y_true = np.asarray(y_true, dtype=float)\n    y_pred = np.asarray(y_pred, dtype=float)\n\n    sse = np.sum((y_true - y_pred) ** 2)\n    sst_c = np.sum((y_true - np.mean(y_true)) ** 2)\n\n    if sst_c == 0:\n        return np.nan  # undefined when y has zero variance\n    return 1.0 - sse \/ sst_c\n\n# Example usage\ny_true = np.array(&#091;10.1, 10.2, 10.3, 10.4, 10.5&#093;)\ny_pred = np.array(&#091;10.0, 10.3, 10.2, 10.5, 10.4&#093;)\n\nprint(f\"Centered R\u00b2:   {centered_r2(y_true, y_pred):.6f}\")\n# Confirm equivalence with scikit-learn\nfrom sklearn.metrics import r2_score\nprint(f\"sklearn r2:    {r2_score(y_true, y_pred):.6f}\")&lt;\/pre><\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D73A49\">def<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #6F42C1\">centered_r2<\/span><span style=\"color: #24292E\">(y_true, y_pred):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #032F62\">&quot;&quot;&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #032F62\">    Centered R\u00b2 (standard R\u00b2)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #032F62\">    R\u00b2_c = 1 - SSE \/ SST_centered<\/span><\/span>\n<span class=\"line\"><span style=\"color: #032F62\">    &quot;&quot;&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    y_true <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.asarray(y_true, <\/span><span style=\"color: #E36209\">dtype<\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #005CC5\">float<\/span><span style=\"color: #24292E\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    y_pred <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.asarray(y_pred, <\/span><span style=\"color: #E36209\">dtype<\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #005CC5\">float<\/span><span style=\"color: #24292E\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    sse <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.sum((y_true <\/span><span style=\"color: #D73A49\">-<\/span><span style=\"color: #24292E\"> y_pred) <\/span><span style=\"color: #D73A49\">**<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">2<\/span><span style=\"color: #24292E\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    sst_c <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.sum((y_true <\/span><span style=\"color: #D73A49\">-<\/span><span style=\"color: #24292E\"> np.mean(y_true)) <\/span><span style=\"color: #D73A49\">**<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">2<\/span><span style=\"color: #24292E\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #D73A49\">if<\/span><span style=\"color: #24292E\"> sst_c <\/span><span style=\"color: #D73A49\">==<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">0<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">        <\/span><span style=\"color: #D73A49\">return<\/span><span style=\"color: #24292E\"> np.nan  <\/span><span style=\"color: #6A737D\"># undefined when y has zero variance<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #D73A49\">return<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">1.0<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #D73A49\">-<\/span><span style=\"color: #24292E\"> sse <\/span><span style=\"color: #D73A49\">\/<\/span><span style=\"color: #24292E\"> sst_c<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Example usage<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">y_true <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.array(&#091;<\/span><span style=\"color: #005CC5\">10.1<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.2<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.3<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.4<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.5<\/span><span style=\"color: #24292E\">&#093;)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">y_pred <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.array(&#091;<\/span><span style=\"color: #005CC5\">10.0<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.3<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.2<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.5<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.4<\/span><span style=\"color: #24292E\">&#093;)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #005CC5\">print<\/span><span style=\"color: #24292E\">(<\/span><span style=\"color: #D73A49\">f<\/span><span style=\"color: #032F62\">&quot;Centered R\u00b2:   <\/span><span style=\"color: #005CC5\">{<\/span><span style=\"color: #24292E\">centered_r2(y_true, y_pred)<\/span><span style=\"color: #D73A49\">:.6f<\/span><span style=\"color: #005CC5\">}<\/span><span style=\"color: #032F62\">&quot;<\/span><span style=\"color: #24292E\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Confirm equivalence with scikit-learn<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D73A49\">from<\/span><span style=\"color: #24292E\"> sklearn.metrics <\/span><span style=\"color: #D73A49\">import<\/span><span style=\"color: #24292E\"> r2_score<\/span><\/span>\n<span class=\"line\"><span style=\"color: #005CC5\">print<\/span><span style=\"color: #24292E\">(<\/span><span style=\"color: #D73A49\">f<\/span><span style=\"color: #032F62\">&quot;sklearn r2:    <\/span><span style=\"color: #005CC5\">{<\/span><span style=\"color: #24292E\">r2_score(y_true, y_pred)<\/span><span style=\"color: #D73A49\">:.6f<\/span><span style=\"color: #005CC5\">}<\/span><span style=\"color: #032F62\">&quot;<\/span><span style=\"color: #24292E\">)<\/span><span style=\"color: #D73A49\">&lt;\/<\/span><span style=\"color: #24292E\">pre<\/span><span style=\"color: #D73A49\">&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Uncentered R\u00b2<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#24292e;--cbp-line-number-width:calc(2 * 0.6 * 1rem);line-height:1.625rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>def uncentered_r2(y_true, y_pred):\n    \"\"\"\n    Uncentered R\u00b2 (origin-based R\u00b2)\n    R\u00b2_u = 1 - SSE \/ SST_uncentered\n         = \u27e8\u0177, \u0177\u27e9 \/ \u27e8y, y\u27e9  (when e \u22a5 \u0177)\n    \"\"\"\n    y_true = np.asarray(y_true, dtype=float)\n    y_pred = np.asarray(y_pred, dtype=float)\n\n    sse = np.sum((y_true - y_pred) ** 2)\n    sst_u = np.sum(y_true ** 2)\n\n    if sst_u == 0:\n        return np.nan\n    return 1.0 - sse \/ sst_u\n\n# Example usage \u2014 comparing predictions on a same-physical-quantity scale (e.g., voltage)\ny_true = np.array(&#091;10.1, 10.2, 10.3, 10.4, 10.5&#093;)\ny_pred = np.array(&#091;10.0, 10.3, 10.2, 10.5, 10.4&#093;)\n\nprint(f\"Uncentered R\u00b2: {uncentered_r2(y_true, y_pred):.6f}\")\n\n# Constant-bias scenario: contrast between the two metrics\ny_pred_biased = y_true + 0.5  # all predictions offset by +0.5\nprint(f\"\\nConstant bias +0.5 scenario:\")\nprint(f\"  Centered R\u00b2:   {centered_r2(y_true, y_pred_biased):.6f}  \"\n      f\"(insensitive to bias)\")\nprint(f\"  Uncentered R\u00b2: {uncentered_r2(y_true, y_pred_biased):.6f}  \"\n      f\"(sensitive to bias)\")&lt;\/pre><\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D73A49\">def<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #6F42C1\">uncentered_r2<\/span><span style=\"color: #24292E\">(y_true, y_pred):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #032F62\">&quot;&quot;&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #032F62\">    Uncentered R\u00b2 (origin-based R\u00b2)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #032F62\">    R\u00b2_u = 1 - SSE \/ SST_uncentered<\/span><\/span>\n<span class=\"line\"><span style=\"color: #032F62\">         = \u27e8\u0177, \u0177\u27e9 \/ \u27e8y, y\u27e9  (when e \u22a5 \u0177)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #032F62\">    &quot;&quot;&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    y_true <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.asarray(y_true, <\/span><span style=\"color: #E36209\">dtype<\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #005CC5\">float<\/span><span style=\"color: #24292E\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    y_pred <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.asarray(y_pred, <\/span><span style=\"color: #E36209\">dtype<\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #005CC5\">float<\/span><span style=\"color: #24292E\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    sse <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.sum((y_true <\/span><span style=\"color: #D73A49\">-<\/span><span style=\"color: #24292E\"> y_pred) <\/span><span style=\"color: #D73A49\">**<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">2<\/span><span style=\"color: #24292E\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    sst_u <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.sum(y_true <\/span><span style=\"color: #D73A49\">**<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">2<\/span><span style=\"color: #24292E\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #D73A49\">if<\/span><span style=\"color: #24292E\"> sst_u <\/span><span style=\"color: #D73A49\">==<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">0<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">        <\/span><span style=\"color: #D73A49\">return<\/span><span style=\"color: #24292E\"> np.nan<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #D73A49\">return<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">1.0<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #D73A49\">-<\/span><span style=\"color: #24292E\"> sse <\/span><span style=\"color: #D73A49\">\/<\/span><span style=\"color: #24292E\"> sst_u<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Example usage \u2014 comparing predictions on a same-physical-quantity scale (e.g., voltage)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">y_true <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.array(&#091;<\/span><span style=\"color: #005CC5\">10.1<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.2<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.3<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.4<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.5<\/span><span style=\"color: #24292E\">&#093;)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">y_pred <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.array(&#091;<\/span><span style=\"color: #005CC5\">10.0<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.3<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.2<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.5<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.4<\/span><span style=\"color: #24292E\">&#093;)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #005CC5\">print<\/span><span style=\"color: #24292E\">(<\/span><span style=\"color: #D73A49\">f<\/span><span style=\"color: #032F62\">&quot;Uncentered R\u00b2: <\/span><span style=\"color: #005CC5\">{<\/span><span style=\"color: #24292E\">uncentered_r2(y_true, y_pred)<\/span><span style=\"color: #D73A49\">:.6f<\/span><span style=\"color: #005CC5\">}<\/span><span style=\"color: #032F62\">&quot;<\/span><span style=\"color: #24292E\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Constant-bias scenario: contrast between the two metrics<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">y_pred_biased <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> y_true <\/span><span style=\"color: #D73A49\">+<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">0.5<\/span><span style=\"color: #24292E\">  <\/span><span style=\"color: #6A737D\"># all predictions offset by +0.5<\/span><\/span>\n<span class=\"line\"><span style=\"color: #005CC5\">print<\/span><span style=\"color: #24292E\">(<\/span><span style=\"color: #D73A49\">f<\/span><span style=\"color: #032F62\">&quot;<\/span><span style=\"color: #005CC5\">\\n<\/span><span style=\"color: #032F62\">Constant bias +0.5 scenario:&quot;<\/span><span style=\"color: #24292E\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #005CC5\">print<\/span><span style=\"color: #24292E\">(<\/span><span style=\"color: #D73A49\">f<\/span><span style=\"color: #032F62\">&quot;  Centered R\u00b2:   <\/span><span style=\"color: #005CC5\">{<\/span><span style=\"color: #24292E\">centered_r2(y_true, y_pred_biased)<\/span><span style=\"color: #D73A49\">:.6f<\/span><span style=\"color: #005CC5\">}<\/span><span style=\"color: #032F62\">  &quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">      <\/span><span style=\"color: #D73A49\">f<\/span><span style=\"color: #032F62\">&quot;(insensitive to bias)&quot;<\/span><span style=\"color: #24292E\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #005CC5\">print<\/span><span style=\"color: #24292E\">(<\/span><span style=\"color: #D73A49\">f<\/span><span style=\"color: #032F62\">&quot;  Uncentered R\u00b2: <\/span><span style=\"color: #005CC5\">{<\/span><span style=\"color: #24292E\">uncentered_r2(y_true, y_pred_biased)<\/span><span style=\"color: #D73A49\">:.6f<\/span><span style=\"color: #005CC5\">}<\/span><span style=\"color: #032F62\">  &quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">      <\/span><span style=\"color: #D73A49\">f<\/span><span style=\"color: #032F62\">&quot;(sensitive to bias)&quot;<\/span><span style=\"color: #24292E\">)<\/span><span style=\"color: #D73A49\">&lt;\/<\/span><span style=\"color: #24292E\">pre<\/span><span style=\"color: #D73A49\">&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Integrated Evaluation for 1:1-Line Agreement<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#24292e;--cbp-line-number-width:calc(2 * 0.6 * 1rem);line-height:1.625rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>def evaluate_1_to_1_line_agreement(y_true, y_pred):\n    \"\"\"Evaluate 1:1-line agreement on same-physical-quantity data.\"\"\"\n    y_true = np.asarray(y_true, dtype=float)\n    y_pred = np.asarray(y_pred, dtype=float)\n    \n    err = y_pred - y_true\n\n    rmse = np.sqrt(np.mean(err ** 2))\n    mae  = np.mean(np.abs(err))                       # Mean Absolute Error\n    bias = np.mean(err)                               # Mean Error (systematic bias)\n    \n    # MAPE: Mean Absolute Percentage Error (%) \u2014 undefined when y_true contains 0\n    mask = y_true != 0\n    if mask.any():\n        mape = np.mean(np.abs(err&#091;mask&#093; \/ y_true&#091;mask&#093;)) * 100.0\n    else:\n        mape = np.nan\n    \n    return {\n        \"CenteredR2\":   centered_r2(y_true, y_pred),\n        \"UncenteredR2\": uncentered_r2(y_true, y_pred),\n        \"RMSE\":         rmse,\n        \"MAE\":          mae,\n        \"MAPE\":         mape,\n        \"Bias\":         bias,\n    }\n\n\n# Example usage\ny_true = np.array(&#091;10.1, 10.2, 10.3, 10.4, 10.5&#093;)\ny_pred = np.array(&#091;10.0, 10.3, 10.2, 10.5, 10.4&#093;)\n\nresults = evaluate_1_to_1_line_agreement(y_true, y_pred)\nfor k, v in results.items():\n    print(f\"{k:>15s}: {v:.6f}\")<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D73A49\">def<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #6F42C1\">evaluate_1_to_1_line_agreement<\/span><span style=\"color: #24292E\">(y_true, y_pred):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #032F62\">&quot;&quot;&quot;Evaluate 1:1-line agreement on same-physical-quantity data.&quot;&quot;&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    y_true <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.asarray(y_true, <\/span><span style=\"color: #E36209\">dtype<\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #005CC5\">float<\/span><span style=\"color: #24292E\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    y_pred <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.asarray(y_pred, <\/span><span style=\"color: #E36209\">dtype<\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #005CC5\">float<\/span><span style=\"color: #24292E\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    err <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> y_pred <\/span><span style=\"color: #D73A49\">-<\/span><span style=\"color: #24292E\"> y_true<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    rmse <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.sqrt(np.mean(err <\/span><span style=\"color: #D73A49\">**<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">2<\/span><span style=\"color: #24292E\">))<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    mae  <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.mean(np.abs(err))                       <\/span><span style=\"color: #6A737D\"># Mean Absolute Error<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    bias <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.mean(err)                               <\/span><span style=\"color: #6A737D\"># Mean Error (systematic bias)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #6A737D\"># MAPE: Mean Absolute Percentage Error (%) \u2014 undefined when y_true contains 0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    mask <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> y_true <\/span><span style=\"color: #D73A49\">!=<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #D73A49\">if<\/span><span style=\"color: #24292E\"> mask.any():<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">        mape <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.mean(np.abs(err&#091;mask&#093; <\/span><span style=\"color: #D73A49\">\/<\/span><span style=\"color: #24292E\"> y_true&#091;mask&#093;)) <\/span><span style=\"color: #D73A49\">*<\/span><span style=\"color: #24292E\"> <\/span><span style=\"color: #005CC5\">100.0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #D73A49\">else<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">        mape <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.nan<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #D73A49\">return<\/span><span style=\"color: #24292E\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">        <\/span><span style=\"color: #032F62\">&quot;CenteredR2&quot;<\/span><span style=\"color: #24292E\">:   centered_r2(y_true, y_pred),<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">        <\/span><span style=\"color: #032F62\">&quot;UncenteredR2&quot;<\/span><span style=\"color: #24292E\">: uncentered_r2(y_true, y_pred),<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">        <\/span><span style=\"color: #032F62\">&quot;RMSE&quot;<\/span><span style=\"color: #24292E\">:         rmse,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">        <\/span><span style=\"color: #032F62\">&quot;MAE&quot;<\/span><span style=\"color: #24292E\">:          mae,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">        <\/span><span style=\"color: #032F62\">&quot;MAPE&quot;<\/span><span style=\"color: #24292E\">:         mape,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">        <\/span><span style=\"color: #032F62\">&quot;Bias&quot;<\/span><span style=\"color: #24292E\">:         bias,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    }<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Example usage<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">y_true <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.array(&#091;<\/span><span style=\"color: #005CC5\">10.1<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.2<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.3<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.4<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.5<\/span><span style=\"color: #24292E\">&#093;)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">y_pred <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> np.array(&#091;<\/span><span style=\"color: #005CC5\">10.0<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.3<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.2<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.5<\/span><span style=\"color: #24292E\">, <\/span><span style=\"color: #005CC5\">10.4<\/span><span style=\"color: #24292E\">&#093;)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">results <\/span><span style=\"color: #D73A49\">=<\/span><span style=\"color: #24292E\"> evaluate_1_to_1_line_agreement(y_true, y_pred)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D73A49\">for<\/span><span style=\"color: #24292E\"> k, v <\/span><span style=\"color: #D73A49\">in<\/span><span style=\"color: #24292E\"> results.items():<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #005CC5\">print<\/span><span style=\"color: #24292E\">(<\/span><span style=\"color: #D73A49\">f<\/span><span style=\"color: #032F62\">&quot;<\/span><span style=\"color: #005CC5\">{<\/span><span style=\"color: #24292E\">k<\/span><span style=\"color: #D73A49\">:&gt;15s<\/span><span style=\"color: #005CC5\">}<\/span><span style=\"color: #032F62\">: <\/span><span style=\"color: #005CC5\">{<\/span><span style=\"color: #24292E\">v<\/span><span style=\"color: #D73A49\">:.6f<\/span><span style=\"color: #005CC5\">}<\/span><span style=\"color: #032F62\">&quot;<\/span><span style=\"color: #24292E\">)<\/span><\/span><\/code><\/pre><\/div>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">References<\/h2>\n\n\n<style>.kadence-column6438_727871-33 > .kt-inside-inner-col{padding-left:var(--global-kb-spacing-sm, 1.5rem);}.kadence-column6438_727871-33 > .kt-inside-inner-col,.kadence-column6438_727871-33 > .kt-inside-inner-col:before{border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;}.kadence-column6438_727871-33 > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column6438_727871-33 > .kt-inside-inner-col{flex-direction:column;}.kadence-column6438_727871-33 > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column6438_727871-33 > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column6438_727871-33{position:relative;}@media all and (max-width: 1024px){.kadence-column6438_727871-33 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column6438_727871-33 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column6438_727871-33\"><div class=\"kt-inside-inner-col\">\n<ul class=\"wp-block-list\">\n<li>Draper, N. R., &amp; Smith, H. (1998). <em>Applied Regression Analysis<\/em> (3rd ed.). Wiley.<\/li>\n\n\n\n<li>Eisenhauer, J. G. (2003). Regression through the origin. <em>Teaching Statistics<\/em>, 25(3), 76\u201380.<\/li>\n\n\n\n<li>Kvalseth, T. O. (1985). Cautionary note about R\u00b2. <em>The American Statistician<\/em>, 39(4), 279\u2013285.<\/li>\n\n\n\n<li>Legates, D. R., &amp; McCabe, G. J. (1999). Evaluating the use of &#8220;goodness-of-fit&#8221; measures in hydrologic and hydroclimatic model validation. <em>Water Resources Research<\/em>, 35(1), 233\u2013241.<\/li>\n\n\n\n<li>Strang, G. (2009). <em>Introduction to Linear Algebra<\/em> (4th ed.). Wellesley-Cambridge Press.<\/li>\n\n\n\n<li>Wooldridge, J. M. (2010). <em>Econometric Analysis of Cross Section and Panel Data<\/em> (2nd ed.). MIT Press.<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<div style='text-align:center' class='yasr-auto-insert-overall'><\/div><div style='text-align:center' class='yasr-auto-insert-visitor'><\/div>","protected":false},"excerpt":{"rendered":"<p>Bondi Iceberg pool 1. Introduction: R\u00b2 and Its Relation to RSQ The coefficient of determination, denoted as R\u00b2 (R-squared), is one of the most widely used validation metrics in statistics and machine learning (ML) for assessing how well predicted values $\\hat{y}$ agree with observed values $y_{true}$. In spreadsheet software and many engineering reports, R\u00b2 is&#8230;<\/p>\n","protected":false},"author":4,"featured_media":6439,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","yasr_overall_rating":0,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","fifu_image_url":"","fifu_image_alt":"","iawp_total_views":0,"footnotes":""},"categories":[56,369],"tags":[],"class_list":["post-6438","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-science-slug","category-evalutaion-metric-slug"],"yasr_visitor_votes":{"stars_attributes":{"read_only":false,"span_bottom":false},"number_of_votes":1,"sum_votes":4},"jetpack_featured_media_url":"https:\/\/ykim.synology.me\/wordpress\/wp-content\/uploads\/2026\/04\/Bondi-Icebergs-pool-765x574px.png","_links":{"self":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/6438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/comments?post=6438"}],"version-history":[{"count":11,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/6438\/revisions"}],"predecessor-version":[{"id":6458,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/6438\/revisions\/6458"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/media\/6439"}],"wp:attachment":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/media?parent=6438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/categories?post=6438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/tags?post=6438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}