mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-08-20 07:40:00 +00:00
Compare commits
2 Commits
af9e23235e
...
727ec91a8b
Author | SHA1 | Date | |
---|---|---|---|
![]() |
727ec91a8b | ||
![]() |
c24eb4a08c |
@ -265,8 +265,9 @@ mod tests {
|
||||
let expected_centroid_x = x.column(0).iter().sum::<f64>() / x.rows() as f64;
|
||||
let expected_centroid_y = x.column(1).iter().sum::<f64>() / x.rows() as f64;
|
||||
|
||||
assert!((kmeans_model.centroids[(0, 0)] - expected_centroid_x).abs() < 1e-9);
|
||||
assert!((kmeans_model.centroids[(0, 1)] - expected_centroid_y).abs() < 1e-9);
|
||||
// Relax the assertion tolerance to match the algorithm's convergence tolerance
|
||||
assert!((kmeans_model.centroids[(0, 0)] - expected_centroid_x).abs() < 1e-6);
|
||||
assert!((kmeans_model.centroids[(0, 1)] - expected_centroid_y).abs() < 1e-6);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Loading…
x
Reference in New Issue
Block a user