MolBasis
pearson-rr-squaredmetricsqspr-validation5 min read

Pearson r versus R² and why they are not the same claim

Pearson r measures linear agreement up to any straight line. R² measures variance explained on the real scale. A model can have r = 1 and R² = 0.5.

Updated November 28, 2026

Pearson r measures how well predictions and measurements line up along some straight line, any straight line. R² measures how much of the measured variance the predictions themselves remove, on the property's actual scale, with no line re-fitted in between. A model can score r = 1 and R² = 0.5 on the same held-out molecules. The two numbers answer different questions, and a QSPR report should say which one it gives and on which data.

What Pearson r measures and what it deliberately ignores

Pearson r is the covariance of predicted and measured values divided by the product of their standard deviations. It runs from −1 to 1. It does not change if every prediction is multiplied by a constant and shifted by another constant. Multiply all predictions by 3 and add 10 and r stays exactly where it was.

That invariance is both the point and the problem. A high r means the model orders the molecules correctly and spaces them in roughly the right proportions. It says nothing about whether the predictions sit on the right scale or near the right values. Predictions that are systematically 2 log units too high have the same r as predictions with no bias at all.

For a melting point prediction this matters. A set of predicted temperatures can correlate well with measured temperatures and still be 60 K too low across the board. Pearson r would not notice.

What R² measures and why it can be negative

R² is defined as 1 minus the residual sum of squares over the total sum of squares. The residual sum is the sum of squared differences between measured and predicted values. The total sum is the sum of squared differences between measured values and their mean.

Read that way, R² compares the model with the simplest possible competitor, a model that predicts the mean for every molecule. R² = 1 means zero residual. R² = 0 means the model does exactly as well as the mean. R² below zero means the model does worse than the mean, and that happens often on held-out molecules when the predictions are biased or over-spread.

There is one special case. For an ordinary least-squares fit with an intercept, evaluated on the data it was fitted on, R² equals the square of r between fitted and measured values. That identity is why many people treat the two as the same number. It breaks on held-out data, and it breaks for ridge regression and for every estimator that is not plain least squares on that same data. In the situation that matters most for validation, r² and R² are different numbers.

A five-point example where r is 1 and R² is 0.5

Take measured values y = 1, 2, 3, 4, 5 and predictions ŷ = 2, 3, 4, 5, 6. Every prediction is exactly 1 too high. The two series move together perfectly, so r = 1.

Now compute R². Each residual is 1, so the residual sum of squares is 5 × 1² = 5. The mean of y is 3, and the total sum of squares is 4 + 1 + 0 + 1 + 4 = 10. R² = 1 − 5/10 = 0.5. A perfect r and a mediocre R² from the same five numbers.

Change the predictions to ŷ = 2, 2.5, 3, 3.5, 4. These are compressed toward the centre. Again r = 1. The residuals are −1, −0.5, 0, 0.5, 1 and their squares sum to 1 + 0.25 + 0 + 0.25 + 1 = 2.5. R² = 1 − 2.5/10 = 0.75. The compression also shows up as a calibration slope far from 1, which r alone cannot reveal.

import numpy as np
from sklearn.metrics import r2_score
y = np.array([1, 2, 3, 4, 5.0])
yhat = np.array([2, 3, 4, 5, 6.0])
r = np.corrcoef(y, yhat)[0, 1]      # 1.0
r2 = r2_score(y, yhat)              # 0.5
print(round(r, 3), round(r2, 3))

Why a kernel page gives r together with two other numbers

The MolBasis protocol reports Pearson r on the held-out molecules of a scaffold-blind split. On its own, that figure would allow a biased or compressed equation to look perfect. So the methodology pairs it with two numbers that live on the property's own scale. The MAE lift against the train-mean baseline says whether the errors are smaller than those of predicting the mean, which is the question R² asks in squared units. The calibration slope says whether a unit change in prediction corresponds to a unit change in measurement.

Each kernel page states its held-out r, the number of molecules it rests on, and the in-sample figure as a secondary value. Read the three held-out numbers together. A high r with a weak lift over the baseline is the signature of a compressed or offset prediction, not of a good one. The guide on MAE versus RMSE explains why the error is reported as a mean absolute deviation.

Reading r and R² in someone else's paper

Three checks take a minute. First, which number is it. Many QSPR papers write R² when they computed r² from a regression of predicted on measured, which hides offset and scale. Second, on which data. An in-sample R² for a model chosen by search is an optimistic number by construction, as the guide on held-out or in-sample, which to quote explains. Third, what the error is in the property's units. A log S model with R² = 0.8 can still have errors of a full log unit if the data spread is wide.

Golbraikh and Tropsha showed in 2002 that a high leave-one-out q² does not guarantee predictive power on an external set. They asked for R² on a test set together with a regression slope through the origin close to 1. That is the same pairing the MolBasis protocol uses in a different form, correlation plus calibration.

A correlation coefficient tells you the shape of the cloud, not where it sits.

Key points

  • Pearson r is invariant to offset and scale. It measures ordering and proportional spacing, nothing else.
  • R² is 1 minus residual variance over total variance. It compares the model with predicting the mean and can be negative on held-out data.
  • r² equals R² only for a least-squares fit with intercept evaluated in-sample. On held-out data they differ.
  • A reported r needs a companion on the property's scale, such as MAE lift, and a calibration slope.
  • Always ask which data the number was computed on. In-sample figures from a searched model are optimistic by construction.

Questions people ask

Is R² just Pearson r squared?
Only in one case, an ordinary least-squares fit with an intercept evaluated on the same data it was fitted on. On held-out data, or for ridge and any other estimator, R² computed as 1 minus residual variance over total variance differs from the square of r. It can even be negative.
Can a model have a high Pearson r and still be useless?
Yes. Pearson r ignores any constant offset and any constant scale factor. Predictions that are all two log units too high, or that move only a quarter as much as the measurements, keep the same r as perfect predictions. MAE and the calibration slope expose those failures.
Which should a QSPR report quote, r or R²?
Quote both, say which data they were computed on, and add an error on the property's own scale such as MAE. A held-out R² says whether the predictions beat the mean on new molecules. A held-out r says whether they rank and space the molecules correctly.

Further reading

In practice: The methodology page describes the checks applied to every kernel, scaffold-blind split included, and the limits of those checks. Every kernel page quotes the held-out figure first and the in-sample figure second.

See the kernels themselves

Every kernel is shown with its held-out result, the number of molecules it rests on and what it cannot be trusted for.