pub fn r2_score(predictions: &[f64], targets: &[f64]) -> f64
R² (coefficient of determination).
R² = 1 - SS_res / SS_tot, where: SS_res = sum((y_true - y_pred)²) SS_tot = sum((y_true - mean(y_true))²)