himalaya.scoring.r2_score

himalaya.scoring.r2_score(y_true, y_pred)[source]

R2 score, computed for multiple predictions (e.g. multiple alphas).

Parameters
y_truearray or Tensor of shape (n_samples, n_targets)

Ground truth.

y_predarray or Tensor of shape (n_predictions, n_samples, n_targets) or (n_samples, n_targets)

Predictions.

Returns
r2array of shape (n_predictions, n_targets) or (n_targets, )

R2 scores.