Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/checking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
fail-fast: false
matrix:
toolchain:
- 1.82.0
- 1.87.0
- stable
- nightly
os:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
fail-fast: false
matrix:
toolchain:
- 1.82.0
- 1.87.0
- stable
os:
- ubuntu-latest
Expand All @@ -35,7 +35,7 @@ jobs:
fail-fast: false
matrix:
toolchain:
- 1.82.0
- 1.87.0
- stable
os:
- ubuntu-latest
Expand Down
18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ 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.15", features = ["approx"] }
ndarray-linalg = { version = "0.16", optional = true }
sprs = { version = "=0.11.1", default-features = false }
ndarray = { version = "0.16", features = ["approx"] }
ndarray-linalg = { version = "0.17", optional = true }
sprs = { version = "0.11", default-features = false }

thiserror = "1.0"
thiserror = "2.0"

criterion = { version = "0.4.0", optional = true }
criterion = { version = "0.5", optional = true }

[dependencies.serde_crate]
package = "serde"
Expand All @@ -56,17 +56,17 @@ default-features = false
features = ["std", "derive"]

[dev-dependencies]
ndarray-rand = "0.14"
ndarray-rand = "0.15"
linfa-datasets = { path = "datasets", features = [
"winequality",
"iris",
"diabetes",
"generate",
] }
statrs = "0.16.0"
statrs = "0.18"

[target.'cfg(not(windows))'.dependencies]
pprof = { version = "0.11.0", features = [
pprof = { version = "0.14", features = [
"flamegraph",
"criterion",
], optional = true }
Expand Down
12 changes: 7 additions & 5 deletions algorithms/linfa-bayes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ default-features = false
features = ["std", "derive"]

[dependencies]
ndarray = { version = "0.15" , features = ["approx"]}
ndarray-stats = "0.5"
thiserror = "1.0"
ndarray = { version = "0.16", features = ["approx"] }
ndarray-stats = "0.6"
thiserror = "2.0"

linfa = { version = "0.7.1", path = "../.." }

[dev-dependencies]
approx = "0.4"
linfa-datasets = { version = "0.7.1", path = "../../datasets", features = ["winequality"] }
approx = "0.5"
linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [
"winequality",
] }
2 changes: 1 addition & 1 deletion algorithms/linfa-bayes/src/base_nb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ where
.mapv(|x| x.exp())
.sum_axis(Axis(1))
.mapv(|x| x.ln())
.into_shape((n_samples, 1))
.into_shape_with_order((n_samples, 1))
.unwrap();

(log_prob_mat - log_prob_x, classes)
Expand Down
2 changes: 1 addition & 1 deletion algorithms/linfa-bayes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub(crate) fn filter<F: Float, L: Label + Ord>(
let index = y
.into_iter()
.enumerate()
.filter(|&(_, y)| (*ycondition == *y))
.filter(|&(_, y)| *ycondition == *y)
.map(|(i, _)| i)
.collect::<Vec<_>>();

Expand Down
20 changes: 10 additions & 10 deletions algorithms/linfa-clustering/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,29 @@ default-features = false
features = ["std", "derive"]

[dependencies]
ndarray = { version = "0.15", features = ["rayon", "approx"] }
linfa-linalg = { version = "0.1", default-features = false }
ndarray-linalg = { version = "0.16", optional = true }
ndarray-rand = "0.14"
ndarray-stats = "0.5"
ndarray = { version = "0.16", features = ["rayon", "approx"] }
linfa-linalg = { version = "0.2", default-features = false }
ndarray-linalg = { version = "0.17", optional = true }
ndarray-rand = "0.15"
ndarray-stats = "0.6"
num-traits = "0.2"
rand_xoshiro = "0.6"
space = "0.12"
thiserror = "1.0"
thiserror = "2.0"
#partitions = "0.2.4" This one will break in a future version of Rust and has no replacement
linfa = { version = "0.7.1", path = "../.." }
linfa-nn = { version = "0.7.2", 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"
criterion = "0.5"
serde_json = "1"
approx = "0.4"
lax = "0.15.0"
approx = "0.5"
lax = "0.17.0"
linfa = { version = "0.7.1", path = "../..", features = ["benchmarks"] }

[[bench]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ impl<F: Float> GaussianMixtureModel<F> {
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()
Expand Down
12 changes: 6 additions & 6 deletions algorithms/linfa-elasticnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ default-features = false
features = ["std", "derive"]

[dependencies]
ndarray = { version = "0.15", features = ["approx"] }
linfa-linalg = { version = "0.1", default-features = false }
ndarray-linalg = { version = "0.16", optional = true }
ndarray = { version = "0.16", features = ["approx"] }
linfa-linalg = { version = "0.2", default-features = false }
ndarray-linalg = { version = "0.17", optional = true }

num-traits = "0.2"
approx = "0.4"
thiserror = "1.0"
approx = "0.5"
thiserror = "2.0"

linfa = { version = "0.7.1", path = "../.." }

Expand All @@ -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"
4 changes: 2 additions & 2 deletions algorithms/linfa-ensemble/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ default-features = false
features = ["std", "derive"]

[dependencies]
ndarray = { version = "0.15", features = ["rayon", "approx"] }
ndarray-rand = "0.14"
ndarray = { version = "0.16", features = ["rayon", "approx"] }
ndarray-rand = "0.15"
rand = "0.8.5"

linfa = { version = "0.7.1", path = "../.." }
Expand Down
14 changes: 7 additions & 7 deletions algorithms/linfa-ftrl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ version = "1.0"
features = ["derive"]

[dependencies]
ndarray = { version = "0.15", 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"] }
thiserror = "1.0"
ndarray = { version = "0.16", features = ["serde"] }
ndarray-rand = "0.15.0"
argmin = { version = "0.11.0", default-features = false }
argmin-math = { version = "0.5", features = ["ndarray_v0_16-nolinalg"] }
thiserror = "2.0"
rand = "0.8.5"
rand_xoshiro = "0.6.0"

linfa = { version = "0.7.1", path = "../.." }

[dev-dependencies]
criterion = "0.4.0"
approx = "0.4"
criterion = "0.5"
approx = "0.5"
linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [
"winequality",
] }
Expand Down
16 changes: 12 additions & 4 deletions algorithms/linfa-hierarchical/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -23,5 +29,7 @@ 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"] }
ndarray-rand = "0.15"
linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [
"iris",
] }
16 changes: 8 additions & 8 deletions algorithms/linfa-ica/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ default-features = false
features = ["std", "derive"]

[dependencies]
ndarray = { version = "0.15" }
linfa-linalg = { version = "0.1", default-features = false }
ndarray-linalg = { version = "0.16", optional = true }
ndarray-rand = "0.14"
ndarray-stats = "0.5"
ndarray = { version = "0.16" }
linfa-linalg = { version = "0.2", default-features = false }
ndarray-linalg = { version = "0.17", optional = true }
ndarray-rand = "0.15"
ndarray-stats = "0.6"
num-traits = "0.2"
rand_xoshiro = "0.6"
thiserror = "1.0"
thiserror = "2.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"
criterion = "0.5"
linfa = { version = "0.7.1", path = "../..", features = ["benchmarks"] }

[[bench]]
Expand Down
4 changes: 2 additions & 2 deletions algorithms/linfa-kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ 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 }
sprs = { version = "0.11", default-features = false }

linfa = { version = "0.7.1", path = "../.." }
linfa-nn = { version = "0.7.2", path = "../linfa-nn" }
18 changes: 9 additions & 9 deletions algorithms/linfa-linear/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ default-features = false
features = ["std", "derive"]

[dependencies]
ndarray = { version = "0.15", features = ["approx"] }
linfa-linalg = { version = "0.1", default-features = false }
ndarray-linalg = { version = "0.16", optional = true }
ndarray = { version = "0.16", features = ["approx"] }
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 }
argmin-math = { version = "0.3", features = ["ndarray_v0_15-nolinalg"] }
thiserror = "1.0"
argmin = { version = "0.11.0", default-features = false }
argmin-math = { version = "0.5", features = ["ndarray_v0_16-nolinalg"] }
thiserror = "2.0"

linfa = { version = "0.7.1", path = "../.." }

[dev-dependencies]
linfa-datasets = { version = "0.7.1", path = "../../datasets", features = [
"diabetes",
] }
approx = "0.4"
criterion = "0.4.0"
statrs = "0.16.0"
approx = "0.5"
criterion = "0.5"
statrs = "0.18"
linfa = { version = "0.7.1", path = "../..", features = ["benchmarks"] }

[[bench]]
Expand Down
3 changes: 1 addition & 2 deletions algorithms/linfa-linear/src/isotonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ impl<F: Float, D: Data<Elem = F>> PredictInplace<ArrayBase<D, Ix2>, Array1<F>>
y[i] = y_min;
} else {
let res = regressor.into_iter().position(|x| x >= &val);
if res.is_some() {
let j = res.unwrap();
if let Some(j) = res {
if val <= regressor[j] && j < n {
let x_scale = (val - regressor[j - 1]) / (regressor[j] - regressor[j - 1]);
y[i] = response[j - 1] + x_scale * (response[j] - response[j - 1]);
Expand Down
12 changes: 6 additions & 6 deletions algorithms/linfa-logistic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ optional = true
version = "1.0"

[dependencies]
ndarray = { version = "0.15", features = ["approx"] }
ndarray-stats = "0.5.0"
ndarray = { version = "0.16", features = ["approx"] }
ndarray-stats = "0.6.0"
num-traits = "0.2"
argmin = { version = "0.9.0", default-features = false }
argmin-math = { version = "0.3", features = ["ndarray_v0_15-nolinalg"] }
thiserror = "1.0"
argmin = { version = "0.11.0", default-features = false }
argmin-math = { version = "0.5", features = ["ndarray_v0_16-nolinalg"] }
thiserror = "2.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",
] }
Expand Down
6 changes: 2 additions & 4 deletions algorithms/linfa-logistic/src/hyperparams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ use serde_crate::{Deserialize, Serialize};
#[cfg_attr(
feature = "serde",
derive(Serialize, Deserialize),
serde(crate = "serde_crate"),
serde(bound(deserialize = "D: Deserialize<'de>"))
serde(crate = "serde_crate")
)]
pub struct LogisticRegressionParams<F: Float, D: Dimension>(LogisticRegressionValidParams<F, D>);

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(
feature = "serde",
derive(Serialize, Deserialize),
serde(crate = "serde_crate"),
serde(bound(deserialize = "D: Deserialize<'de>"))
serde(crate = "serde_crate")
)]
pub struct LogisticRegressionValidParams<F: Float, D: Dimension> {
pub(crate) alpha: F,
Expand Down
Loading
Loading