mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-08-20 04:00:01 +00:00
Simplify t-test assertion in unit test for clarity
This commit is contained in:
parent
b2f6794e05
commit
a335d29347
@ -106,11 +106,7 @@ mod tests {
|
|||||||
let sample1 = Matrix::from_vec(vec![1.0, 2.0, 3.0, 4.0, 5.0], 1, 5);
|
let sample1 = Matrix::from_vec(vec![1.0, 2.0, 3.0, 4.0, 5.0], 1, 5);
|
||||||
let sample2 = Matrix::from_vec(vec![6.0, 7.0, 8.0, 9.0, 10.0], 1, 5);
|
let sample2 = Matrix::from_vec(vec![6.0, 7.0, 8.0, 9.0, 10.0], 1, 5);
|
||||||
let (t_statistic, p_value) = t_test(&sample1, &sample2);
|
let (t_statistic, p_value) = t_test(&sample1, &sample2);
|
||||||
assert!(
|
assert!((t_statistic + 5.0).abs() < EPS);
|
||||||
(t_statistic + 5.0).abs() < EPS,
|
|
||||||
"Expected t-statistic close to -5.0 found: {}",
|
|
||||||
t_statistic
|
|
||||||
);
|
|
||||||
assert!(p_value > 0.0 && p_value < 1.0);
|
assert!(p_value > 0.0 && p_value < 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user