arviz.r2_score

arviz.r2_score(y_true, y_pred)[source]

R² for Bayesian regression models. Only valid for linear models.

Parameters:
y_true: : array-like of shape = (n_samples) or (n_samples, n_outputs)

Ground truth (correct) target values.

y_pred : array-like of shape = (n_samples) or (n_samples, n_outputs)

Estimated target values.

Returns:
Pandas Series with the following indices:
r2: Bayesian R²
r2_std: standard deviation of the Bayesian R².