r2_score

Function r2_score 

Source
pub fn r2_score(predictions: &[f64], targets: &[f64]) -> f64
Expand description

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))²)