From f3a14ac6dbffae10c4e09ea8d6e682dbc4fe4c72 Mon Sep 17 00:00:00 2001 From: relf Date: Wed, 29 Jan 2025 17:00:45 +0100 Subject: [PATCH 01/12] Bump ndarray version to 0.16 --- Cargo.toml | 2 +- algorithms/linfa-bayes/Cargo.toml | 6 ++++-- algorithms/linfa-clustering/Cargo.toml | 2 +- algorithms/linfa-elasticnet/Cargo.toml | 2 +- algorithms/linfa-ftrl/Cargo.toml | 2 +- algorithms/linfa-hierarchical/Cargo.toml | 14 +++++++++++--- algorithms/linfa-ica/Cargo.toml | 2 +- algorithms/linfa-kernel/Cargo.toml | 2 +- algorithms/linfa-linear/Cargo.toml | 2 +- algorithms/linfa-logistic/Cargo.toml | 2 +- algorithms/linfa-nn/Cargo.toml | 2 +- algorithms/linfa-pls/Cargo.toml | 2 +- algorithms/linfa-preprocessing/Cargo.toml | 2 +- algorithms/linfa-reduction/Cargo.toml | 2 +- algorithms/linfa-svm/Cargo.toml | 2 +- algorithms/linfa-trees/Cargo.toml | 6 ++++-- algorithms/linfa-tsne/Cargo.toml | 6 ++++-- datasets/Cargo.toml | 2 +- 18 files changed, 37 insertions(+), 23 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d284d10da..095e382c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,7 @@ num-traits = "0.2" rand = { version = "0.8", features = ["small_rng"] } approx = "0.4" -ndarray = { version = "0.15", features = ["approx"] } +ndarray = { version = "0.16", features = ["approx"] } ndarray-linalg = { version = "0.16", optional = true } sprs = { version = "=0.11.1", default-features = false } diff --git a/algorithms/linfa-bayes/Cargo.toml b/algorithms/linfa-bayes/Cargo.toml index 5030a7e45..3fd2ed472 100644 --- a/algorithms/linfa-bayes/Cargo.toml +++ b/algorithms/linfa-bayes/Cargo.toml @@ -21,7 +21,7 @@ default-features = false features = ["std", "derive"] [dependencies] -ndarray = { version = "0.15" , features = ["approx"]} +ndarray = { version = "0.16", features = ["approx"] } ndarray-stats = "0.5" thiserror = "1.0" @@ -29,4 +29,6 @@ linfa = { version = "0.7.1", path = "../.." } [dev-dependencies] approx = "0.4" -linfa-datasets = { version = "0.7.1", path = "../../datasets", features = ["winequality"] } +linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [ + "winequality", +] } diff --git a/algorithms/linfa-clustering/Cargo.toml b/algorithms/linfa-clustering/Cargo.toml index 11ba07da9..c96a17e51 100644 --- a/algorithms/linfa-clustering/Cargo.toml +++ b/algorithms/linfa-clustering/Cargo.toml @@ -35,7 +35,7 @@ default-features = false features = ["std", "derive"] [dependencies] -ndarray = { version = "0.15", features = ["rayon", "approx"] } +ndarray = { version = "0.16", features = ["rayon", "approx"] } linfa-linalg = { version = "0.1", default-features = false } ndarray-linalg = { version = "0.16", optional = true } ndarray-rand = "0.14" diff --git a/algorithms/linfa-elasticnet/Cargo.toml b/algorithms/linfa-elasticnet/Cargo.toml index 2148c0d11..807e521f4 100644 --- a/algorithms/linfa-elasticnet/Cargo.toml +++ b/algorithms/linfa-elasticnet/Cargo.toml @@ -29,7 +29,7 @@ default-features = false features = ["std", "derive"] [dependencies] -ndarray = { version = "0.15", features = ["approx"] } +ndarray = { version = "0.16", features = ["approx"] } linfa-linalg = { version = "0.1", default-features = false } ndarray-linalg = { version = "0.16", optional = true } diff --git a/algorithms/linfa-ftrl/Cargo.toml b/algorithms/linfa-ftrl/Cargo.toml index 716fb6476..cf5426636 100644 --- a/algorithms/linfa-ftrl/Cargo.toml +++ b/algorithms/linfa-ftrl/Cargo.toml @@ -24,7 +24,7 @@ version = "1.0" features = ["derive"] [dependencies] -ndarray = { version = "0.15.4", features = ["serde"] } +ndarray = { version = "0.16", features = ["serde"] } ndarray-rand = "0.14.0" argmin = { version = "0.9.0", default-features = false } argmin-math = { version = "0.3", features = ["ndarray_v0_15-nolinalg"] } diff --git a/algorithms/linfa-hierarchical/Cargo.toml b/algorithms/linfa-hierarchical/Cargo.toml index f8aafb7cd..2caf0e1c9 100644 --- a/algorithms/linfa-hierarchical/Cargo.toml +++ b/algorithms/linfa-hierarchical/Cargo.toml @@ -10,11 +10,17 @@ license = "MIT OR Apache-2.0" repository = "https://github.com/rust-ml/linfa" readme = "README.md" -keywords = ["hierachical", "agglomerative", "clustering", "machine-learning", "linfa"] +keywords = [ + "hierachical", + "agglomerative", + "clustering", + "machine-learning", + "linfa", +] categories = ["algorithms", "mathematics", "science"] [dependencies] -ndarray = { version = "0.15" } +ndarray = { version = "0.16" } kodama = "0.2" thiserror = "1.0.25" @@ -24,4 +30,6 @@ linfa-kernel = { version = "0.7.1", path = "../linfa-kernel" } [dev-dependencies] rand = "0.8" ndarray-rand = "0.14" -linfa-datasets = { version = "0.7.1", path = "../../datasets", features = ["iris"] } +linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [ + "iris", +] } diff --git a/algorithms/linfa-ica/Cargo.toml b/algorithms/linfa-ica/Cargo.toml index 7dcdb7561..bf6c8649b 100644 --- a/algorithms/linfa-ica/Cargo.toml +++ b/algorithms/linfa-ica/Cargo.toml @@ -25,7 +25,7 @@ default-features = false features = ["std", "derive"] [dependencies] -ndarray = { version = "0.15" } +ndarray = { version = "0.16" } linfa-linalg = { version = "0.1", default-features = false } ndarray-linalg = { version = "0.16", optional = true } ndarray-rand = "0.14" diff --git a/algorithms/linfa-kernel/Cargo.toml b/algorithms/linfa-kernel/Cargo.toml index e6792a91c..55ab88739 100644 --- a/algorithms/linfa-kernel/Cargo.toml +++ b/algorithms/linfa-kernel/Cargo.toml @@ -24,7 +24,7 @@ default-features = false features = ["std", "derive"] [dependencies] -ndarray = "0.15" +ndarray = "0.16" num-traits = "0.2" sprs = { version = "=0.11.1", default-features = false } diff --git a/algorithms/linfa-linear/Cargo.toml b/algorithms/linfa-linear/Cargo.toml index 0c9f7ec6d..63de16242 100644 --- a/algorithms/linfa-linear/Cargo.toml +++ b/algorithms/linfa-linear/Cargo.toml @@ -29,7 +29,7 @@ default-features = false features = ["std", "derive"] [dependencies] -ndarray = { version = "0.15", features = ["approx"] } +ndarray = { version = "0.16", features = ["approx"] } linfa-linalg = { version = "0.1", default-features = false } ndarray-linalg = { version = "0.16", optional = true } num-traits = "0.2" diff --git a/algorithms/linfa-logistic/Cargo.toml b/algorithms/linfa-logistic/Cargo.toml index a0d25223b..948f3c80d 100644 --- a/algorithms/linfa-logistic/Cargo.toml +++ b/algorithms/linfa-logistic/Cargo.toml @@ -23,7 +23,7 @@ optional = true version = "1.0" [dependencies] -ndarray = { version = "0.15", features = ["approx"] } +ndarray = { version = "0.16", features = ["approx"] } ndarray-stats = "0.5.0" num-traits = "0.2" argmin = { version = "0.9.0", default-features = false } diff --git a/algorithms/linfa-nn/Cargo.toml b/algorithms/linfa-nn/Cargo.toml index f599668b3..c1a13ea34 100644 --- a/algorithms/linfa-nn/Cargo.toml +++ b/algorithms/linfa-nn/Cargo.toml @@ -24,7 +24,7 @@ default-features = false features = ["std", "derive"] [dependencies] -ndarray = { version = "0.15", features = ["approx"]} +ndarray = { version = "0.16", features = ["approx"] } ndarray-stats = "0.5" num-traits = "0.2.0" noisy_float = "0.2.0" diff --git a/algorithms/linfa-pls/Cargo.toml b/algorithms/linfa-pls/Cargo.toml index 13002b8ad..4ea68ed96 100644 --- a/algorithms/linfa-pls/Cargo.toml +++ b/algorithms/linfa-pls/Cargo.toml @@ -25,7 +25,7 @@ default-features = false features = ["std", "derive"] [dependencies] -ndarray = { version = "0.15" } +ndarray = { version = "0.16" } linfa-linalg = { version = "0.1", default-features = false } ndarray-linalg = { version = "0.16", optional = true } ndarray-stats = "0.5" diff --git a/algorithms/linfa-preprocessing/Cargo.toml b/algorithms/linfa-preprocessing/Cargo.toml index f6878e081..e48f652a4 100644 --- a/algorithms/linfa-preprocessing/Cargo.toml +++ b/algorithms/linfa-preprocessing/Cargo.toml @@ -19,7 +19,7 @@ serde = ["serde_crate", "ndarray/serde", "serde_regex"] [dependencies] linfa = { version = "0.7.1", path = "../.." } -ndarray = { version = "0.15", features = ["approx"] } +ndarray = { version = "0.16", features = ["approx"] } ndarray-linalg = { version = "0.16", optional = true } linfa-linalg = { version = "0.1", default-features = false } ndarray-stats = "0.5" diff --git a/algorithms/linfa-reduction/Cargo.toml b/algorithms/linfa-reduction/Cargo.toml index c1de0c2f9..726012425 100644 --- a/algorithms/linfa-reduction/Cargo.toml +++ b/algorithms/linfa-reduction/Cargo.toml @@ -34,7 +34,7 @@ default-features = false features = ["std", "derive"] [dependencies] -ndarray = { version = "0.15", features = ["approx"] } +ndarray = { version = "0.16", features = ["approx"] } linfa-linalg = { version = "0.1" } ndarray-linalg = { version = "0.16", optional = true } ndarray-rand = "0.14" diff --git a/algorithms/linfa-svm/Cargo.toml b/algorithms/linfa-svm/Cargo.toml index c99784495..81349a661 100644 --- a/algorithms/linfa-svm/Cargo.toml +++ b/algorithms/linfa-svm/Cargo.toml @@ -24,7 +24,7 @@ default-features = false features = ["std", "derive"] [dependencies] -ndarray = { version = "0.15" } +ndarray = { version = "0.16" } ndarray-rand = "0.14" num-traits = "0.2" thiserror = "1.0" diff --git a/algorithms/linfa-trees/Cargo.toml b/algorithms/linfa-trees/Cargo.toml index a270ec6af..6046c6f47 100644 --- a/algorithms/linfa-trees/Cargo.toml +++ b/algorithms/linfa-trees/Cargo.toml @@ -24,7 +24,7 @@ default-features = false features = ["std", "derive"] [dependencies] -ndarray = { version = "0.15" , features = ["rayon", "approx"]} +ndarray = { version = "0.16", features = ["rayon", "approx"] } ndarray-rand = "0.14" linfa = { version = "0.7.1", path = "../.." } @@ -33,7 +33,9 @@ linfa = { version = "0.7.1", path = "../.." } rand = { version = "0.8", features = ["small_rng"] } criterion = "0.4.0" approx = "0.4" -linfa-datasets = { version = "0.7.1", path = "../../datasets/", features = ["iris"] } +linfa-datasets = { version = "0.7.1", path = "../../datasets/", features = [ + "iris", +] } linfa = { version = "0.7.1", path = "../..", features = ["benchmarks"] } [[bench]] diff --git a/algorithms/linfa-tsne/Cargo.toml b/algorithms/linfa-tsne/Cargo.toml index 2cb7ebe7d..4487990a5 100644 --- a/algorithms/linfa-tsne/Cargo.toml +++ b/algorithms/linfa-tsne/Cargo.toml @@ -15,7 +15,7 @@ categories = ["algorithms", "mathematics", "science"] [dependencies] thiserror = "1.0" -ndarray = { version = "0.15" } +ndarray = { version = "0.16" } ndarray-rand = "0.14" bhtsne = "0.4.0" pdqselect = "=0.1.0" @@ -26,7 +26,9 @@ linfa = { version = "0.7.1", path = "../.." } rand = "0.8" approx = "0.4" -linfa-datasets = { version = "0.7.1", path = "../../datasets", features = ["iris"] } +linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [ + "iris", +] } linfa-reduction = { version = "0.7.1", path = "../linfa-reduction" } [target.'cfg(not(target_family = "windows"))'.dev-dependencies] diff --git a/datasets/Cargo.toml b/datasets/Cargo.toml index 77dbdd587..e4631f6b9 100644 --- a/datasets/Cargo.toml +++ b/datasets/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://github.com/rust-ml/linfa" [dependencies] linfa = { version = "0.7.1", path = ".." } -ndarray = { version = "0.15" } +ndarray = { version = "0.16" } ndarray-csv = "=0.5.1" csv = "1.1" flate2 = "1.0" From 2f396818d075dd89875c210ec044338d801942c2 Mon Sep 17 00:00:00 2001 From: relf Date: Wed, 29 Jan 2025 17:02:28 +0100 Subject: [PATCH 02/12] Bump ndarray-linalg version to 0.17 --- Cargo.toml | 2 +- algorithms/linfa-clustering/Cargo.toml | 2 +- algorithms/linfa-elasticnet/Cargo.toml | 2 +- algorithms/linfa-ica/Cargo.toml | 2 +- algorithms/linfa-linear/Cargo.toml | 2 +- algorithms/linfa-pls/Cargo.toml | 2 +- algorithms/linfa-preprocessing/Cargo.toml | 2 +- algorithms/linfa-reduction/Cargo.toml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 095e382c5..00b3b3036 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ rand = { version = "0.8", features = ["small_rng"] } approx = "0.4" ndarray = { version = "0.16", features = ["approx"] } -ndarray-linalg = { version = "0.16", optional = true } +ndarray-linalg = { version = "0.17", optional = true } sprs = { version = "=0.11.1", default-features = false } thiserror = "1.0" diff --git a/algorithms/linfa-clustering/Cargo.toml b/algorithms/linfa-clustering/Cargo.toml index c96a17e51..180ebb53f 100644 --- a/algorithms/linfa-clustering/Cargo.toml +++ b/algorithms/linfa-clustering/Cargo.toml @@ -37,7 +37,7 @@ features = ["std", "derive"] [dependencies] ndarray = { version = "0.16", features = ["rayon", "approx"] } linfa-linalg = { version = "0.1", default-features = false } -ndarray-linalg = { version = "0.16", optional = true } +ndarray-linalg = { version = "0.17", optional = true } ndarray-rand = "0.14" ndarray-stats = "0.5" num-traits = "0.2" diff --git a/algorithms/linfa-elasticnet/Cargo.toml b/algorithms/linfa-elasticnet/Cargo.toml index 807e521f4..5a0912add 100644 --- a/algorithms/linfa-elasticnet/Cargo.toml +++ b/algorithms/linfa-elasticnet/Cargo.toml @@ -31,7 +31,7 @@ features = ["std", "derive"] [dependencies] ndarray = { version = "0.16", features = ["approx"] } linfa-linalg = { version = "0.1", default-features = false } -ndarray-linalg = { version = "0.16", optional = true } +ndarray-linalg = { version = "0.17", optional = true } num-traits = "0.2" approx = "0.4" diff --git a/algorithms/linfa-ica/Cargo.toml b/algorithms/linfa-ica/Cargo.toml index bf6c8649b..93c16bbb7 100644 --- a/algorithms/linfa-ica/Cargo.toml +++ b/algorithms/linfa-ica/Cargo.toml @@ -27,7 +27,7 @@ features = ["std", "derive"] [dependencies] ndarray = { version = "0.16" } linfa-linalg = { version = "0.1", default-features = false } -ndarray-linalg = { version = "0.16", optional = true } +ndarray-linalg = { version = "0.17", optional = true } ndarray-rand = "0.14" ndarray-stats = "0.5" num-traits = "0.2" diff --git a/algorithms/linfa-linear/Cargo.toml b/algorithms/linfa-linear/Cargo.toml index 63de16242..1f18cee3d 100644 --- a/algorithms/linfa-linear/Cargo.toml +++ b/algorithms/linfa-linear/Cargo.toml @@ -31,7 +31,7 @@ features = ["std", "derive"] [dependencies] ndarray = { version = "0.16", features = ["approx"] } linfa-linalg = { version = "0.1", default-features = false } -ndarray-linalg = { version = "0.16", optional = true } +ndarray-linalg = { version = "0.17", optional = true } num-traits = "0.2" argmin = { version = "0.9.0", default-features = false } argmin-math = { version = "0.3", features = ["ndarray_v0_15-nolinalg"] } diff --git a/algorithms/linfa-pls/Cargo.toml b/algorithms/linfa-pls/Cargo.toml index 4ea68ed96..973c6c6ab 100644 --- a/algorithms/linfa-pls/Cargo.toml +++ b/algorithms/linfa-pls/Cargo.toml @@ -27,7 +27,7 @@ features = ["std", "derive"] [dependencies] ndarray = { version = "0.16" } linfa-linalg = { version = "0.1", default-features = false } -ndarray-linalg = { version = "0.16", optional = true } +ndarray-linalg = { version = "0.17", optional = true } ndarray-stats = "0.5" ndarray-rand = "0.14" num-traits = "0.2" diff --git a/algorithms/linfa-preprocessing/Cargo.toml b/algorithms/linfa-preprocessing/Cargo.toml index e48f652a4..c08724a1c 100644 --- a/algorithms/linfa-preprocessing/Cargo.toml +++ b/algorithms/linfa-preprocessing/Cargo.toml @@ -20,7 +20,7 @@ serde = ["serde_crate", "ndarray/serde", "serde_regex"] [dependencies] linfa = { version = "0.7.1", path = "../.." } ndarray = { version = "0.16", features = ["approx"] } -ndarray-linalg = { version = "0.16", optional = true } +ndarray-linalg = { version = "0.17", optional = true } linfa-linalg = { version = "0.1", default-features = false } ndarray-stats = "0.5" thiserror = "1.0" diff --git a/algorithms/linfa-reduction/Cargo.toml b/algorithms/linfa-reduction/Cargo.toml index 726012425..84205e209 100644 --- a/algorithms/linfa-reduction/Cargo.toml +++ b/algorithms/linfa-reduction/Cargo.toml @@ -36,7 +36,7 @@ features = ["std", "derive"] [dependencies] ndarray = { version = "0.16", features = ["approx"] } linfa-linalg = { version = "0.1" } -ndarray-linalg = { version = "0.16", optional = true } +ndarray-linalg = { version = "0.17", optional = true } ndarray-rand = "0.14" num-traits = "0.2" thiserror = "1.0" From 3ae5153d2dd88909bb8a608b0ec42149d300e456 Mon Sep 17 00:00:00 2001 From: relf Date: Wed, 29 Jan 2025 17:06:28 +0100 Subject: [PATCH 03/12] Bump ndarray-stats version to 0.6 --- algorithms/linfa-bayes/Cargo.toml | 2 +- algorithms/linfa-clustering/Cargo.toml | 2 +- algorithms/linfa-ica/Cargo.toml | 2 +- algorithms/linfa-nn/Cargo.toml | 2 +- algorithms/linfa-pls/Cargo.toml | 2 +- algorithms/linfa-preprocessing/Cargo.toml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/algorithms/linfa-bayes/Cargo.toml b/algorithms/linfa-bayes/Cargo.toml index 3fd2ed472..cd03aacae 100644 --- a/algorithms/linfa-bayes/Cargo.toml +++ b/algorithms/linfa-bayes/Cargo.toml @@ -22,7 +22,7 @@ features = ["std", "derive"] [dependencies] ndarray = { version = "0.16", features = ["approx"] } -ndarray-stats = "0.5" +ndarray-stats = "0.6" thiserror = "1.0" linfa = { version = "0.7.1", path = "../.." } diff --git a/algorithms/linfa-clustering/Cargo.toml b/algorithms/linfa-clustering/Cargo.toml index 180ebb53f..91b8f597a 100644 --- a/algorithms/linfa-clustering/Cargo.toml +++ b/algorithms/linfa-clustering/Cargo.toml @@ -39,7 +39,7 @@ ndarray = { version = "0.16", features = ["rayon", "approx"] } linfa-linalg = { version = "0.1", default-features = false } ndarray-linalg = { version = "0.17", optional = true } ndarray-rand = "0.14" -ndarray-stats = "0.5" +ndarray-stats = "0.6" num-traits = "0.2" rand_xoshiro = "0.6" space = "0.12" diff --git a/algorithms/linfa-ica/Cargo.toml b/algorithms/linfa-ica/Cargo.toml index 93c16bbb7..85bba34f5 100644 --- a/algorithms/linfa-ica/Cargo.toml +++ b/algorithms/linfa-ica/Cargo.toml @@ -29,7 +29,7 @@ ndarray = { version = "0.16" } linfa-linalg = { version = "0.1", default-features = false } ndarray-linalg = { version = "0.17", optional = true } ndarray-rand = "0.14" -ndarray-stats = "0.5" +ndarray-stats = "0.6" num-traits = "0.2" rand_xoshiro = "0.6" thiserror = "1.0" diff --git a/algorithms/linfa-nn/Cargo.toml b/algorithms/linfa-nn/Cargo.toml index c1a13ea34..2c1a4c5a1 100644 --- a/algorithms/linfa-nn/Cargo.toml +++ b/algorithms/linfa-nn/Cargo.toml @@ -25,7 +25,7 @@ features = ["std", "derive"] [dependencies] ndarray = { version = "0.16", features = ["approx"] } -ndarray-stats = "0.5" +ndarray-stats = "0.6" num-traits = "0.2.0" noisy_float = "0.2.0" order-stat = "0.1.3" diff --git a/algorithms/linfa-pls/Cargo.toml b/algorithms/linfa-pls/Cargo.toml index 973c6c6ab..cbe817022 100644 --- a/algorithms/linfa-pls/Cargo.toml +++ b/algorithms/linfa-pls/Cargo.toml @@ -28,7 +28,7 @@ features = ["std", "derive"] ndarray = { version = "0.16" } linfa-linalg = { version = "0.1", default-features = false } ndarray-linalg = { version = "0.17", optional = true } -ndarray-stats = "0.5" +ndarray-stats = "0.6" ndarray-rand = "0.14" num-traits = "0.2" paste = "1.0" diff --git a/algorithms/linfa-preprocessing/Cargo.toml b/algorithms/linfa-preprocessing/Cargo.toml index c08724a1c..5821bd51c 100644 --- a/algorithms/linfa-preprocessing/Cargo.toml +++ b/algorithms/linfa-preprocessing/Cargo.toml @@ -22,7 +22,7 @@ linfa = { version = "0.7.1", path = "../.." } ndarray = { version = "0.16", features = ["approx"] } ndarray-linalg = { version = "0.17", optional = true } linfa-linalg = { version = "0.1", default-features = false } -ndarray-stats = "0.5" +ndarray-stats = "0.6" thiserror = "1.0" approx = { version = "0.4" } ndarray-rand = { version = "0.14" } From 5e5ac3ad0f41a8c759686928f8aa0efca33d7415 Mon Sep 17 00:00:00 2001 From: relf Date: Wed, 29 Jan 2025 17:09:11 +0100 Subject: [PATCH 04/12] Bump ndarray-rand version to 0.15 --- Cargo.toml | 2 +- algorithms/linfa-clustering/Cargo.toml | 2 +- algorithms/linfa-elasticnet/Cargo.toml | 2 +- algorithms/linfa-hierarchical/Cargo.toml | 2 +- algorithms/linfa-ica/Cargo.toml | 2 +- algorithms/linfa-nn/Cargo.toml | 2 +- algorithms/linfa-pls/Cargo.toml | 2 +- algorithms/linfa-reduction/Cargo.toml | 2 +- algorithms/linfa-svm/Cargo.toml | 2 +- algorithms/linfa-trees/Cargo.toml | 2 +- algorithms/linfa-tsne/Cargo.toml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 00b3b3036..a8206615c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,7 +56,7 @@ default-features = false features = ["std", "derive"] [dev-dependencies] -ndarray-rand = "0.14" +ndarray-rand = "0.15" linfa-datasets = { path = "datasets", features = [ "winequality", "iris", diff --git a/algorithms/linfa-clustering/Cargo.toml b/algorithms/linfa-clustering/Cargo.toml index 91b8f597a..d1466d61c 100644 --- a/algorithms/linfa-clustering/Cargo.toml +++ b/algorithms/linfa-clustering/Cargo.toml @@ -38,7 +38,7 @@ features = ["std", "derive"] ndarray = { version = "0.16", features = ["rayon", "approx"] } linfa-linalg = { version = "0.1", default-features = false } ndarray-linalg = { version = "0.17", optional = true } -ndarray-rand = "0.14" +ndarray-rand = "0.15" ndarray-stats = "0.6" num-traits = "0.2" rand_xoshiro = "0.6" diff --git a/algorithms/linfa-elasticnet/Cargo.toml b/algorithms/linfa-elasticnet/Cargo.toml index 5a0912add..e669ab98e 100644 --- a/algorithms/linfa-elasticnet/Cargo.toml +++ b/algorithms/linfa-elasticnet/Cargo.toml @@ -44,5 +44,5 @@ linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [ "diabetes", "linnerud", ] } -ndarray-rand = "0.14" +ndarray-rand = "0.15" rand_xoshiro = "0.6" diff --git a/algorithms/linfa-hierarchical/Cargo.toml b/algorithms/linfa-hierarchical/Cargo.toml index 2caf0e1c9..bf658cd20 100644 --- a/algorithms/linfa-hierarchical/Cargo.toml +++ b/algorithms/linfa-hierarchical/Cargo.toml @@ -29,7 +29,7 @@ linfa-kernel = { version = "0.7.1", path = "../linfa-kernel" } [dev-dependencies] rand = "0.8" -ndarray-rand = "0.14" +ndarray-rand = "0.15" linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [ "iris", ] } diff --git a/algorithms/linfa-ica/Cargo.toml b/algorithms/linfa-ica/Cargo.toml index 85bba34f5..b294ab3a1 100644 --- a/algorithms/linfa-ica/Cargo.toml +++ b/algorithms/linfa-ica/Cargo.toml @@ -28,7 +28,7 @@ features = ["std", "derive"] ndarray = { version = "0.16" } linfa-linalg = { version = "0.1", default-features = false } ndarray-linalg = { version = "0.17", optional = true } -ndarray-rand = "0.14" +ndarray-rand = "0.15" ndarray-stats = "0.6" num-traits = "0.2" rand_xoshiro = "0.6" diff --git a/algorithms/linfa-nn/Cargo.toml b/algorithms/linfa-nn/Cargo.toml index 2c1a4c5a1..3493857b2 100644 --- a/algorithms/linfa-nn/Cargo.toml +++ b/algorithms/linfa-nn/Cargo.toml @@ -39,7 +39,7 @@ linfa = { version = "0.7.1", path = "../.." } approx = "0.4" criterion = "0.4.0" rand_xoshiro = "0.6" -ndarray-rand = "0.14" +ndarray-rand = "0.15" linfa = { version = "0.7.1", path = "../..", features = ["benchmarks"] } [[bench]] diff --git a/algorithms/linfa-pls/Cargo.toml b/algorithms/linfa-pls/Cargo.toml index cbe817022..9253abf88 100644 --- a/algorithms/linfa-pls/Cargo.toml +++ b/algorithms/linfa-pls/Cargo.toml @@ -29,7 +29,7 @@ ndarray = { version = "0.16" } linfa-linalg = { version = "0.1", default-features = false } ndarray-linalg = { version = "0.17", optional = true } ndarray-stats = "0.6" -ndarray-rand = "0.14" +ndarray-rand = "0.15" num-traits = "0.2" paste = "1.0" thiserror = "1.0" diff --git a/algorithms/linfa-reduction/Cargo.toml b/algorithms/linfa-reduction/Cargo.toml index 84205e209..2fe7b6095 100644 --- a/algorithms/linfa-reduction/Cargo.toml +++ b/algorithms/linfa-reduction/Cargo.toml @@ -37,7 +37,7 @@ features = ["std", "derive"] ndarray = { version = "0.16", features = ["approx"] } linfa-linalg = { version = "0.1" } ndarray-linalg = { version = "0.17", optional = true } -ndarray-rand = "0.14" +ndarray-rand = "0.15" num-traits = "0.2" thiserror = "1.0" rand = { version = "0.8", features = ["small_rng"] } diff --git a/algorithms/linfa-svm/Cargo.toml b/algorithms/linfa-svm/Cargo.toml index 81349a661..e2fb66d4c 100644 --- a/algorithms/linfa-svm/Cargo.toml +++ b/algorithms/linfa-svm/Cargo.toml @@ -25,7 +25,7 @@ features = ["std", "derive"] [dependencies] ndarray = { version = "0.16" } -ndarray-rand = "0.14" +ndarray-rand = "0.15" num-traits = "0.2" thiserror = "1.0" diff --git a/algorithms/linfa-trees/Cargo.toml b/algorithms/linfa-trees/Cargo.toml index 6046c6f47..642fd0069 100644 --- a/algorithms/linfa-trees/Cargo.toml +++ b/algorithms/linfa-trees/Cargo.toml @@ -25,7 +25,7 @@ features = ["std", "derive"] [dependencies] ndarray = { version = "0.16", features = ["rayon", "approx"] } -ndarray-rand = "0.14" +ndarray-rand = "0.15" linfa = { version = "0.7.1", path = "../.." } diff --git a/algorithms/linfa-tsne/Cargo.toml b/algorithms/linfa-tsne/Cargo.toml index 4487990a5..1e92845e7 100644 --- a/algorithms/linfa-tsne/Cargo.toml +++ b/algorithms/linfa-tsne/Cargo.toml @@ -16,7 +16,7 @@ categories = ["algorithms", "mathematics", "science"] [dependencies] thiserror = "1.0" ndarray = { version = "0.16" } -ndarray-rand = "0.14" +ndarray-rand = "0.15" bhtsne = "0.4.0" pdqselect = "=0.1.0" From e6cbae2713880e4263fbe275cf809bd380934eba Mon Sep 17 00:00:00 2001 From: relf Date: Wed, 29 Jan 2025 17:14:43 +0100 Subject: [PATCH 05/12] Unpin ndarray-csv --- datasets/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datasets/Cargo.toml b/datasets/Cargo.toml index e4631f6b9..ba605ad8e 100644 --- a/datasets/Cargo.toml +++ b/datasets/Cargo.toml @@ -10,10 +10,10 @@ repository = "https://github.com/rust-ml/linfa" [dependencies] linfa = { version = "0.7.1", path = ".." } ndarray = { version = "0.16" } -ndarray-csv = "=0.5.1" +ndarray-csv = "0.5" csv = "1.1" flate2 = "1.0" -ndarray-rand = { version = "0.14", optional = true } +ndarray-rand = { version = "0.15", optional = true } [dev-dependencies] approx = "0.4" From a4f4586040474affa727925af3ade76578a9f0a5 Mon Sep 17 00:00:00 2001 From: relf Date: Wed, 29 Jan 2025 17:16:12 +0100 Subject: [PATCH 06/12] Bump approx version to 0.5 --- Cargo.toml | 2 +- algorithms/linfa-bayes/Cargo.toml | 2 +- algorithms/linfa-clustering/Cargo.toml | 2 +- algorithms/linfa-elasticnet/Cargo.toml | 2 +- algorithms/linfa-ftrl/Cargo.toml | 2 +- algorithms/linfa-linear/Cargo.toml | 2 +- algorithms/linfa-logistic/Cargo.toml | 2 +- algorithms/linfa-nn/Cargo.toml | 2 +- algorithms/linfa-pls/Cargo.toml | 2 +- algorithms/linfa-svm/Cargo.toml | 2 +- algorithms/linfa-trees/Cargo.toml | 2 +- algorithms/linfa-tsne/Cargo.toml | 2 +- datasets/Cargo.toml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a8206615c..9ba95025a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ serde = ["serde_crate", "ndarray/serde"] [dependencies] num-traits = "0.2" rand = { version = "0.8", features = ["small_rng"] } -approx = "0.4" +approx = "0.5" ndarray = { version = "0.16", features = ["approx"] } ndarray-linalg = { version = "0.17", optional = true } diff --git a/algorithms/linfa-bayes/Cargo.toml b/algorithms/linfa-bayes/Cargo.toml index cd03aacae..ae7e48654 100644 --- a/algorithms/linfa-bayes/Cargo.toml +++ b/algorithms/linfa-bayes/Cargo.toml @@ -28,7 +28,7 @@ thiserror = "1.0" linfa = { version = "0.7.1", path = "../.." } [dev-dependencies] -approx = "0.4" +approx = "0.5" linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [ "winequality", ] } diff --git a/algorithms/linfa-clustering/Cargo.toml b/algorithms/linfa-clustering/Cargo.toml index d1466d61c..ffd6f1e1a 100644 --- a/algorithms/linfa-clustering/Cargo.toml +++ b/algorithms/linfa-clustering/Cargo.toml @@ -56,7 +56,7 @@ linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [ ] } criterion = "0.4.0" serde_json = "1" -approx = "0.4" +approx = "0.5" lax = "0.15.0" linfa = { version = "0.7.1", path = "../..", features = ["benchmarks"] } diff --git a/algorithms/linfa-elasticnet/Cargo.toml b/algorithms/linfa-elasticnet/Cargo.toml index e669ab98e..cbf505825 100644 --- a/algorithms/linfa-elasticnet/Cargo.toml +++ b/algorithms/linfa-elasticnet/Cargo.toml @@ -34,7 +34,7 @@ linfa-linalg = { version = "0.1", default-features = false } ndarray-linalg = { version = "0.17", optional = true } num-traits = "0.2" -approx = "0.4" +approx = "0.5" thiserror = "1.0" linfa = { version = "0.7.1", path = "../.." } diff --git a/algorithms/linfa-ftrl/Cargo.toml b/algorithms/linfa-ftrl/Cargo.toml index cf5426636..daf95440c 100644 --- a/algorithms/linfa-ftrl/Cargo.toml +++ b/algorithms/linfa-ftrl/Cargo.toml @@ -36,7 +36,7 @@ linfa = { version = "0.7.1", path = "../.." } [dev-dependencies] criterion = "0.4.0" -approx = "0.4" +approx = "0.5" linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [ "winequality", ] } diff --git a/algorithms/linfa-linear/Cargo.toml b/algorithms/linfa-linear/Cargo.toml index 1f18cee3d..00fad5aa9 100644 --- a/algorithms/linfa-linear/Cargo.toml +++ b/algorithms/linfa-linear/Cargo.toml @@ -43,7 +43,7 @@ linfa = { version = "0.7.1", path = "../.." } linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [ "diabetes", ] } -approx = "0.4" +approx = "0.5" criterion = "0.4.0" statrs = "0.16.0" linfa = { version = "0.7.1", path = "../..", features = ["benchmarks"] } diff --git a/algorithms/linfa-logistic/Cargo.toml b/algorithms/linfa-logistic/Cargo.toml index 948f3c80d..0b5130225 100644 --- a/algorithms/linfa-logistic/Cargo.toml +++ b/algorithms/linfa-logistic/Cargo.toml @@ -34,7 +34,7 @@ thiserror = "1.0" linfa = { version = "0.7.1", path = "../.." } [dev-dependencies] -approx = "0.4" +approx = "0.5" linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [ "winequality", ] } diff --git a/algorithms/linfa-nn/Cargo.toml b/algorithms/linfa-nn/Cargo.toml index 3493857b2..9a8c3e699 100644 --- a/algorithms/linfa-nn/Cargo.toml +++ b/algorithms/linfa-nn/Cargo.toml @@ -36,7 +36,7 @@ kdtree = "0.6.0" linfa = { version = "0.7.1", path = "../.." } [dev-dependencies] -approx = "0.4" +approx = "0.5" criterion = "0.4.0" rand_xoshiro = "0.6" ndarray-rand = "0.15" diff --git a/algorithms/linfa-pls/Cargo.toml b/algorithms/linfa-pls/Cargo.toml index 9253abf88..9db9c6488 100644 --- a/algorithms/linfa-pls/Cargo.toml +++ b/algorithms/linfa-pls/Cargo.toml @@ -40,7 +40,7 @@ linfa = { version = "0.7.1", path = "../..", features = ["benchmarks"] } linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [ "linnerud", ] } -approx = "0.4" +approx = "0.5" rand_xoshiro = "0.6" criterion = "0.4.0" statrs = "0.16.0" diff --git a/algorithms/linfa-svm/Cargo.toml b/algorithms/linfa-svm/Cargo.toml index e2fb66d4c..d220cf9f0 100644 --- a/algorithms/linfa-svm/Cargo.toml +++ b/algorithms/linfa-svm/Cargo.toml @@ -38,4 +38,4 @@ linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [ "diabetes", ] } rand_xoshiro = "0.6" -approx = "0.4" +approx = "0.5" diff --git a/algorithms/linfa-trees/Cargo.toml b/algorithms/linfa-trees/Cargo.toml index 642fd0069..b0907c339 100644 --- a/algorithms/linfa-trees/Cargo.toml +++ b/algorithms/linfa-trees/Cargo.toml @@ -32,7 +32,7 @@ linfa = { version = "0.7.1", path = "../.." } [dev-dependencies] rand = { version = "0.8", features = ["small_rng"] } criterion = "0.4.0" -approx = "0.4" +approx = "0.5" linfa-datasets = { version = "0.7.1", path = "../../datasets/", features = [ "iris", ] } diff --git a/algorithms/linfa-tsne/Cargo.toml b/algorithms/linfa-tsne/Cargo.toml index 1e92845e7..0d860d3c2 100644 --- a/algorithms/linfa-tsne/Cargo.toml +++ b/algorithms/linfa-tsne/Cargo.toml @@ -24,7 +24,7 @@ linfa = { version = "0.7.1", path = "../.." } [dev-dependencies] rand = "0.8" -approx = "0.4" +approx = "0.5" linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [ "iris", diff --git a/datasets/Cargo.toml b/datasets/Cargo.toml index ba605ad8e..5ded9426f 100644 --- a/datasets/Cargo.toml +++ b/datasets/Cargo.toml @@ -16,7 +16,7 @@ flate2 = "1.0" ndarray-rand = { version = "0.15", optional = true } [dev-dependencies] -approx = "0.4" +approx = "0.5" statrs = "0.16.0" [features] From 473db708640d332fc81466e5b9751dbd9697094c Mon Sep 17 00:00:00 2001 From: relf Date: Wed, 29 Jan 2025 17:17:59 +0100 Subject: [PATCH 07/12] Bump linfa-linalg version to 0.2 --- algorithms/linfa-clustering/Cargo.toml | 2 +- algorithms/linfa-elasticnet/Cargo.toml | 2 +- algorithms/linfa-ica/Cargo.toml | 2 +- algorithms/linfa-linear/Cargo.toml | 2 +- algorithms/linfa-pls/Cargo.toml | 2 +- algorithms/linfa-preprocessing/Cargo.toml | 2 +- algorithms/linfa-reduction/Cargo.toml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/algorithms/linfa-clustering/Cargo.toml b/algorithms/linfa-clustering/Cargo.toml index ffd6f1e1a..48348659d 100644 --- a/algorithms/linfa-clustering/Cargo.toml +++ b/algorithms/linfa-clustering/Cargo.toml @@ -36,7 +36,7 @@ features = ["std", "derive"] [dependencies] ndarray = { version = "0.16", features = ["rayon", "approx"] } -linfa-linalg = { version = "0.1", default-features = false } +linfa-linalg = { version = "0.2", default-features = false } ndarray-linalg = { version = "0.17", optional = true } ndarray-rand = "0.15" ndarray-stats = "0.6" diff --git a/algorithms/linfa-elasticnet/Cargo.toml b/algorithms/linfa-elasticnet/Cargo.toml index cbf505825..aedf9fa7b 100644 --- a/algorithms/linfa-elasticnet/Cargo.toml +++ b/algorithms/linfa-elasticnet/Cargo.toml @@ -30,7 +30,7 @@ features = ["std", "derive"] [dependencies] ndarray = { version = "0.16", features = ["approx"] } -linfa-linalg = { version = "0.1", default-features = false } +linfa-linalg = { version = "0.2", default-features = false } ndarray-linalg = { version = "0.17", optional = true } num-traits = "0.2" diff --git a/algorithms/linfa-ica/Cargo.toml b/algorithms/linfa-ica/Cargo.toml index b294ab3a1..ea0d82354 100644 --- a/algorithms/linfa-ica/Cargo.toml +++ b/algorithms/linfa-ica/Cargo.toml @@ -26,7 +26,7 @@ features = ["std", "derive"] [dependencies] ndarray = { version = "0.16" } -linfa-linalg = { version = "0.1", default-features = false } +linfa-linalg = { version = "0.2", default-features = false } ndarray-linalg = { version = "0.17", optional = true } ndarray-rand = "0.15" ndarray-stats = "0.6" diff --git a/algorithms/linfa-linear/Cargo.toml b/algorithms/linfa-linear/Cargo.toml index 00fad5aa9..0421b49d9 100644 --- a/algorithms/linfa-linear/Cargo.toml +++ b/algorithms/linfa-linear/Cargo.toml @@ -30,7 +30,7 @@ features = ["std", "derive"] [dependencies] ndarray = { version = "0.16", features = ["approx"] } -linfa-linalg = { version = "0.1", default-features = false } +linfa-linalg = { version = "0.2", default-features = false } ndarray-linalg = { version = "0.17", optional = true } num-traits = "0.2" argmin = { version = "0.9.0", default-features = false } diff --git a/algorithms/linfa-pls/Cargo.toml b/algorithms/linfa-pls/Cargo.toml index 9db9c6488..368a825a3 100644 --- a/algorithms/linfa-pls/Cargo.toml +++ b/algorithms/linfa-pls/Cargo.toml @@ -26,7 +26,7 @@ features = ["std", "derive"] [dependencies] ndarray = { version = "0.16" } -linfa-linalg = { version = "0.1", default-features = false } +linfa-linalg = { version = "0.2", default-features = false } ndarray-linalg = { version = "0.17", optional = true } ndarray-stats = "0.6" ndarray-rand = "0.15" diff --git a/algorithms/linfa-preprocessing/Cargo.toml b/algorithms/linfa-preprocessing/Cargo.toml index 5821bd51c..1778dc31b 100644 --- a/algorithms/linfa-preprocessing/Cargo.toml +++ b/algorithms/linfa-preprocessing/Cargo.toml @@ -21,7 +21,7 @@ serde = ["serde_crate", "ndarray/serde", "serde_regex"] linfa = { version = "0.7.1", path = "../.." } ndarray = { version = "0.16", features = ["approx"] } ndarray-linalg = { version = "0.17", optional = true } -linfa-linalg = { version = "0.1", default-features = false } +linfa-linalg = { version = "0.2", default-features = false } ndarray-stats = "0.6" thiserror = "1.0" approx = { version = "0.4" } diff --git a/algorithms/linfa-reduction/Cargo.toml b/algorithms/linfa-reduction/Cargo.toml index 2fe7b6095..00f2fdb33 100644 --- a/algorithms/linfa-reduction/Cargo.toml +++ b/algorithms/linfa-reduction/Cargo.toml @@ -35,7 +35,7 @@ features = ["std", "derive"] [dependencies] ndarray = { version = "0.16", features = ["approx"] } -linfa-linalg = { version = "0.1" } +linfa-linalg = { version = "0.2" } ndarray-linalg = { version = "0.17", optional = true } ndarray-rand = "0.15" num-traits = "0.2" From 10c54057e3426b7f25dfa164f99aea6dab103a39 Mon Sep 17 00:00:00 2001 From: relf Date: Wed, 29 Jan 2025 17:23:46 +0100 Subject: [PATCH 08/12] Unpin sprs --- Cargo.toml | 2 +- algorithms/linfa-kernel/Cargo.toml | 2 +- algorithms/linfa-preprocessing/Cargo.toml | 2 +- algorithms/linfa-reduction/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9ba95025a..61b8475ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ approx = "0.5" ndarray = { version = "0.16", features = ["approx"] } ndarray-linalg = { version = "0.17", optional = true } -sprs = { version = "=0.11.1", default-features = false } +sprs = { version = "0.11", default-features = false } thiserror = "1.0" diff --git a/algorithms/linfa-kernel/Cargo.toml b/algorithms/linfa-kernel/Cargo.toml index 55ab88739..87da7486c 100644 --- a/algorithms/linfa-kernel/Cargo.toml +++ b/algorithms/linfa-kernel/Cargo.toml @@ -26,7 +26,7 @@ features = ["std", "derive"] [dependencies] ndarray = "0.16" num-traits = "0.2" -sprs = { version = "=0.11.1", default-features = false } +sprs = { version = "0.11", default-features = false } linfa = { version = "0.7.1", path = "../.." } linfa-nn = { version = "0.7.1", path = "../linfa-nn" } diff --git a/algorithms/linfa-preprocessing/Cargo.toml b/algorithms/linfa-preprocessing/Cargo.toml index 1778dc31b..cee7194ca 100644 --- a/algorithms/linfa-preprocessing/Cargo.toml +++ b/algorithms/linfa-preprocessing/Cargo.toml @@ -29,7 +29,7 @@ ndarray-rand = { version = "0.14" } unicode-normalization = "0.1.8" regex = "1.4.5" encoding = "0.2" -sprs = { version = "=0.11.1", default-features = false } +sprs = { version = "0.11", default-features = false } serde_regex = { version = "1.1", optional = true } diff --git a/algorithms/linfa-reduction/Cargo.toml b/algorithms/linfa-reduction/Cargo.toml index 00f2fdb33..7d0c84e11 100644 --- a/algorithms/linfa-reduction/Cargo.toml +++ b/algorithms/linfa-reduction/Cargo.toml @@ -44,7 +44,7 @@ rand = { version = "0.8", features = ["small_rng"] } linfa = { version = "0.7.1", path = "../.." } linfa-kernel = { version = "0.7.1", path = "../linfa-kernel" } -sprs = "=0.11.1" +sprs = { version = "0.11" } rand_xoshiro = "0.6.0" [dev-dependencies] From 2389ee62d27ba78ac2702462f95e624b3bda31dd Mon Sep 17 00:00:00 2001 From: relf Date: Wed, 29 Jan 2025 18:51:53 +0100 Subject: [PATCH 09/12] Fix forgotten bumps --- algorithms/linfa-clustering/Cargo.toml | 4 ++-- algorithms/linfa-ica/Cargo.toml | 2 +- algorithms/linfa-preprocessing/Cargo.toml | 4 ++-- algorithms/linfa-reduction/Cargo.toml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/algorithms/linfa-clustering/Cargo.toml b/algorithms/linfa-clustering/Cargo.toml index 48348659d..ebb211ce9 100644 --- a/algorithms/linfa-clustering/Cargo.toml +++ b/algorithms/linfa-clustering/Cargo.toml @@ -50,14 +50,14 @@ linfa-nn = { version = "0.7.1", path = "../linfa-nn" } noisy_float = "0.2.0" [dev-dependencies] -ndarray-npy = { version = "0.8", default-features = false } +ndarray-npy = { version = "0.9", default-features = false } linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [ "generate", ] } criterion = "0.4.0" serde_json = "1" approx = "0.5" -lax = "0.15.0" +lax = "0.17.0" linfa = { version = "0.7.1", path = "../..", features = ["benchmarks"] } [[bench]] diff --git a/algorithms/linfa-ica/Cargo.toml b/algorithms/linfa-ica/Cargo.toml index ea0d82354..d33da9be6 100644 --- a/algorithms/linfa-ica/Cargo.toml +++ b/algorithms/linfa-ica/Cargo.toml @@ -37,7 +37,7 @@ thiserror = "1.0" linfa = { version = "0.7.1", path = "../.." } [dev-dependencies] -ndarray-npy = { version = "0.8", default-features = false } +ndarray-npy = { version = "0.9", default-features = false } paste = "1.0" criterion = "0.4.0" linfa = { version = "0.7.1", path = "../..", features = ["benchmarks"] } diff --git a/algorithms/linfa-preprocessing/Cargo.toml b/algorithms/linfa-preprocessing/Cargo.toml index cee7194ca..638bd29eb 100644 --- a/algorithms/linfa-preprocessing/Cargo.toml +++ b/algorithms/linfa-preprocessing/Cargo.toml @@ -24,8 +24,8 @@ ndarray-linalg = { version = "0.17", optional = true } linfa-linalg = { version = "0.2", default-features = false } ndarray-stats = "0.6" thiserror = "1.0" -approx = { version = "0.4" } -ndarray-rand = { version = "0.14" } +approx = "0.5" +ndarray-rand = "0.15" unicode-normalization = "0.1.8" regex = "1.4.5" encoding = "0.2" diff --git a/algorithms/linfa-reduction/Cargo.toml b/algorithms/linfa-reduction/Cargo.toml index 7d0c84e11..c658a957c 100644 --- a/algorithms/linfa-reduction/Cargo.toml +++ b/algorithms/linfa-reduction/Cargo.toml @@ -48,11 +48,11 @@ sprs = { version = "0.11" } rand_xoshiro = "0.6.0" [dev-dependencies] -ndarray-npy = { version = "0.8", default-features = false } +ndarray-npy = { version = "0.9", default-features = false } linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [ "iris", "generate", ] } -approx = { version = "0.4" } +approx = "0.5" mnist = { version = "0.6.0", features = ["download"] } linfa-trees = { version = "0.7.1", path = "../linfa-trees" } From 0abb1740776d8ba2f1c457eb9de2adb7d46ce2f3 Mon Sep 17 00:00:00 2001 From: relf Date: Wed, 29 Jan 2025 19:31:12 +0100 Subject: [PATCH 10/12] Fix deprecated into_shape() --- .../src/gaussian_mixture/algorithm.rs | 2 +- .../linfa-svm/examples/noisy_sin_svr.rs | 2 +- algorithms/linfa-svm/src/regression.rs | 20 +++++++++++++------ src/composing/multi_target_model.rs | 2 +- src/dataset/impl_dataset.rs | 2 +- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/algorithms/linfa-clustering/src/gaussian_mixture/algorithm.rs b/algorithms/linfa-clustering/src/gaussian_mixture/algorithm.rs index 5d3da7524..54ddf222e 100644 --- a/algorithms/linfa-clustering/src/gaussian_mixture/algorithm.rs +++ b/algorithms/linfa-clustering/src/gaussian_mixture/algorithm.rs @@ -390,7 +390,7 @@ impl GaussianMixtureModel { let n_clusters = matrix_chol.shape()[0]; let log_diags = &matrix_chol .to_owned() - .into_shape((n_clusters, n_features * n_features)) + .into_shape_with_order((n_clusters, n_features * n_features)) .unwrap() .slice(s![.., ..; n_features+1]) .to_owned() diff --git a/algorithms/linfa-svm/examples/noisy_sin_svr.rs b/algorithms/linfa-svm/examples/noisy_sin_svr.rs index ca8cc64fb..595d12aeb 100644 --- a/algorithms/linfa-svm/examples/noisy_sin_svr.rs +++ b/algorithms/linfa-svm/examples/noisy_sin_svr.rs @@ -23,7 +23,7 @@ fn main() -> Result<()> { .filter(|(i, _)| i % 5 == 0) .for_each(|(_, y)| *y = 3. * (0.5 - rng.gen::())); - let x = x.into_shape((40, 1)).unwrap(); + let x = x.into_shape_with_order((40, 1)).unwrap(); let dataset = DatasetBase::new(x, y); let model = Svm::params() .c_svr(100., Some(0.1)) diff --git a/algorithms/linfa-svm/src/regression.rs b/algorithms/linfa-svm/src/regression.rs index 77aa50a6f..7bc8b2b1d 100644 --- a/algorithms/linfa-svm/src/regression.rs +++ b/algorithms/linfa-svm/src/regression.rs @@ -221,7 +221,7 @@ pub mod tests { fn test_epsilon_regression_linear() -> Result<()> { // simple 2d straight line let targets = Array::linspace(0f64, 10., 100); - let records = targets.clone().into_shape((100, 1)).unwrap(); + let records = targets.clone().into_shape_with_order((100, 1)).unwrap(); let dataset = Dataset::new(records, targets); let model = Svm::params() @@ -245,7 +245,7 @@ pub mod tests { fn test_nu_regression_linear() -> Result<()> { // simple 2d straight line let targets = Array::linspace(0f64, 10., 100); - let records = targets.clone().into_shape((100, 1)).unwrap(); + let records = targets.clone().into_shape_with_order((100, 1)).unwrap(); let dataset = Dataset::new(records, targets); // Test the precomputed dot product in the linear kernel case @@ -268,9 +268,12 @@ pub mod tests { #[test] fn test_epsilon_regression_gaussian() -> Result<()> { let records = Array::linspace(0f64, 10., 100) - .into_shape((100, 1)) + .into_shape_with_order((100, 1)) + .unwrap(); + let sin_curve = records + .mapv(|v| v.sin()) + .into_shape_with_order((100,)) .unwrap(); - let sin_curve = records.mapv(|v| v.sin()).into_shape((100,)).unwrap(); let dataset = Dataset::new(records, sin_curve); let model = Svm::params() @@ -285,8 +288,13 @@ pub mod tests { #[test] fn test_nu_regression_polynomial() -> Result<()> { let n = 100; - let records = Array::linspace(0f64, 5., n).into_shape((n, 1)).unwrap(); - let sin_curve = records.mapv(|v| v.sin()).into_shape((n,)).unwrap(); + let records = Array::linspace(0f64, 5., n) + .into_shape_with_order((n, 1)) + .unwrap(); + let sin_curve = records + .mapv(|v| v.sin()) + .into_shape_with_order((n,)) + .unwrap(); let dataset = Dataset::new(records, sin_curve); let model = Svm::params() diff --git a/src/composing/multi_target_model.rs b/src/composing/multi_target_model.rs index 31341d184..3ffaac34a 100644 --- a/src/composing/multi_target_model.rs +++ b/src/composing/multi_target_model.rs @@ -49,7 +49,7 @@ impl> PredictInplace, Array2< targets.into_raw_vec() }) .collect::>() - .into_shape((self.models.len(), arr.len_of(Axis(0)))) + .into_shape_with_order((self.models.len(), arr.len_of(Axis(0)))) .unwrap() .reversed_axes(); } diff --git a/src/dataset/impl_dataset.rs b/src/dataset/impl_dataset.rs index 239a144e8..4b29617bb 100644 --- a/src/dataset/impl_dataset.rs +++ b/src/dataset/impl_dataset.rs @@ -124,7 +124,7 @@ impl Dataset { // Convert 2D targets to 1D. Only works for targets with shape of form [X, 1], panics otherwise. pub fn into_single_target(self) -> Dataset { let nsamples = self.records.nsamples(); - let targets = self.targets.into_shape(nsamples).unwrap(); + let targets = self.targets.into_shape_with_order(nsamples).unwrap(); let features = self.records; Dataset::new(features, targets) } From b48b20e4af88ad7b0eaaa3a97a7bc08e98f177f0 Mon Sep 17 00:00:00 2001 From: relf Date: Wed, 29 Jan 2025 20:36:38 +0100 Subject: [PATCH 11/12] Fix deprecated into_raw_vec() --- src/composing/multi_target_model.rs | 7 ++++++- src/dataset/impl_dataset.rs | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/composing/multi_target_model.rs b/src/composing/multi_target_model.rs index 3ffaac34a..86c73d3e1 100644 --- a/src/composing/multi_target_model.rs +++ b/src/composing/multi_target_model.rs @@ -40,13 +40,18 @@ impl> PredictInplace, Array2< &[arr.nrows(), self.models.len()], "The number of data points must match the number of output targets." ); + assert!( + targets.is_standard_layout(), + "targets not in row-major layout" + ); *targets = self .models .iter() .flat_map(|model| { let mut targets = Array1::default(arr.nrows()); model.predict_inplace(arr, &mut targets); - targets.into_raw_vec() + let (v, _) = targets.into_raw_vec_and_offset(); + v }) .collect::>() .into_shape_with_order((self.models.len(), arr.len_of(Axis(0)))) diff --git a/src/dataset/impl_dataset.rs b/src/dataset/impl_dataset.rs index 4b29617bb..f36668c2f 100644 --- a/src/dataset/impl_dataset.rs +++ b/src/dataset/impl_dataset.rs @@ -960,7 +960,7 @@ impl Dataset { let feature_names = self.feature_names(); // split records into two disjoint arrays - let mut array_buf = self.records.into_raw_vec(); + let (mut array_buf, _) = self.records.into_raw_vec_and_offset(); let second_array_buf = array_buf.split_off(n1 * nfeatures); let first = Array2::from_shape_vec((n1, nfeatures), array_buf).unwrap(); @@ -969,7 +969,7 @@ impl Dataset { // split targets into two disjoint Vec let dim1 = self.targets.raw_dim().nsamples(n1); let dim2 = self.targets.raw_dim().nsamples(n2); - let mut array_buf = self.targets.into_raw_vec(); + let (mut array_buf, _) = self.targets.into_raw_vec_and_offset(); let second_array_buf = array_buf.split_off(dim1.size()); let first_targets = Array::from_shape_vec(dim1, array_buf).unwrap(); @@ -977,7 +977,7 @@ impl Dataset { // split weights into two disjoint Vec let second_weights = if self.weights.len() == n1 + n2 { - let mut weights = self.weights.into_raw_vec(); + let (mut weights, _) = self.weights.into_raw_vec_and_offset(); let weights2 = weights.split_off(n1); self.weights = Array1::from(weights); From 70bee1d33aed4275800b95db0a05df4e3ceb021f Mon Sep 17 00:00:00 2001 From: relf Date: Wed, 29 Jan 2025 21:13:17 +0100 Subject: [PATCH 12/12] Fix deprecated into_shape() --- algorithms/linfa-logistic/src/lib.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/algorithms/linfa-logistic/src/lib.rs b/algorithms/linfa-logistic/src/lib.rs index 833dbab0b..49f068aca 100644 --- a/algorithms/linfa-logistic/src/lib.rs +++ b/algorithms/linfa-logistic/src/lib.rs @@ -476,9 +476,9 @@ fn logistic_loss>( ) -> F { let n_features = x.shape()[1]; let (params, intercept) = convert_params(n_features, w); - let yz = x.dot(¶ms.into_shape((params.len(), 1)).unwrap()) + intercept; + let yz = x.dot(¶ms.into_shape_with_order((params.len(), 1)).unwrap()) + intercept; let len = yz.len(); - let mut yz = yz.into_shape(len).unwrap() * y; + let mut yz = yz.into_shape_with_order(len).unwrap() * y; yz.mapv_inplace(log_logistic); -yz.sum() + F::cast(0.5) * alpha * params.dot(¶ms) } @@ -492,9 +492,9 @@ fn logistic_grad>( ) -> Array1 { let n_features = x.shape()[1]; let (params, intercept) = convert_params(n_features, w); - let yz = x.dot(¶ms.into_shape((params.len(), 1)).unwrap()) + intercept; + let yz = x.dot(¶ms.into_shape_with_order((params.len(), 1)).unwrap()) + intercept; let len = yz.len(); - let mut yz = yz.into_shape(len).unwrap() * y; + let mut yz = yz.into_shape_with_order(len).unwrap() * y; yz.mapv_inplace(logistic); yz -= F::one(); yz *= y; @@ -523,7 +523,10 @@ fn multi_logistic_prob_params<'a, F: Float, A: Data>( let h = x.dot(¶ms) + intercept; // This computes `H - log(sum(exp(H)))`, which is equal to // `log(softmax(H)) = log(exp(H) / sum(exp(H)))` - let log_prob = &h - log_sum_exp(&h, Axis(1)).into_shape((h.nrows(), 1)).unwrap(); + let log_prob = &h + - log_sum_exp(&h, Axis(1)) + .into_shape_with_order((h.nrows(), 1)) + .unwrap(); (log_prob, params) }