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:
@@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user