fix: fix code to be compatible with rand 0.8, following the recommendations of https://rust-random.github.io/book/update-0.8.html and https://docs.rs/getrandom/0.2.2/getrandom/#webassembly-support

This commit is contained in:
Luis Moreno
2021-04-28 16:28:43 -04:00
parent 703dc9688b
commit c295a0d1bb
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -245,7 +245,7 @@ impl<T: RealNumber + Sum> KMeans<T> {
let mut rng = rand::thread_rng();
let (n, m) = data.shape();
let mut y = vec![0; n];
let mut centroid = data.get_row_as_vec(rng.gen_range(0, n));
let mut centroid = data.get_row_as_vec(rng.gen_range(0..n));
let mut d = vec![T::max_value(); n];