pub fn test_normality<F, S1, S2, D1, D2>(
y_true: &ArrayBase<S1, D1>,
y_pred: &ArrayBase<S2, D2>,
) -> Result<F>Expand description
Checks for normality of residuals using Shapiro-Wilk test
§Arguments
y_true- Ground truth (correct) target valuesy_pred- Estimated target values
§Returns
- Shapiro-Wilk test statistic
§Examples
use scirs2_core::ndarray::array;
use scirs2_metrics::regression::test_normality;
let y_true = array![3.0, -0.5, 2.0, 7.0, 5.0, 8.0, 1.0, 4.0];
let y_pred = array![2.5, 0.0, 2.0, 8.0, 4.5, 7.5, 1.5, 3.5];
let sw_stat = test_normality(&y_true, &y_pred).unwrap();
// SW statistic ranges from 0 to 1, with values close to 1 indicating normality
assert!(sw_stat >= 0.0 && sw_stat <= 1.0);