Skip to content

Commit

Permalink
Merge branch 'rust-ml:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-montes authored Oct 19, 2023
2 parents d6a66c9 + 39b3eee commit 5eefd38
Show file tree
Hide file tree
Showing 40 changed files with 425 additions and 180 deletions.
4 changes: 2 additions & 2 deletions .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.65.0
- 1.67.0
- stable
- nightly
os:
Expand Down Expand Up @@ -39,4 +39,4 @@ jobs:
run: cargo check --workspace --all-targets

- name: Run cargo check (with serde)
run: cargo check --workspace --all-targets --features "linfa-clustering/serde linfa-ica/serde linfa-kernel/serde linfa-reduction/serde linfa-svm/serde linfa-elasticnet/serde linfa-pls/serde linfa-trees/serde linfa-nn/serde linfa-linear/serde linfa-preprocessing/serde linfa-bayes/serde"
run: cargo check --workspace --all-targets --features "linfa-clustering/serde linfa-ica/serde linfa-kernel/serde linfa-reduction/serde linfa-svm/serde linfa-elasticnet/serde linfa-pls/serde linfa-trees/serde linfa-nn/serde linfa-linear/serde linfa-preprocessing/serde linfa-bayes/serde linfa-logistic/serde linfa-ftrl/serde"
2 changes: 1 addition & 1 deletion .github/workflows/codequality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
toolchain:
- 1.65.0
- 1.67.0
- stable

steps:
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.65.0
- 1.67.0
- stable
os:
- ubuntu-latest
Expand All @@ -35,7 +35,7 @@ jobs:
fail-fast: false
matrix:
toolchain:
- 1.65.0
- 1.67.0
- stable
os:
- ubuntu-latest
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
Version 0.7.0 - 2023-10-15
========================
Changes
-----------
* add `array_from_gz_csv` and `array_from_csv` in `linfa-datasets`
* make Serde support in `linfa-linear`, `linfa-logistic`, and `linfa-ftrl` optional
* bump `argmin` to 0.8.1
* add Serde support to `linfa-preprocessing` and `linfa-bayes`
* make licenses follow SPDX 2.1 license expression standard

Removals
-----------
* Removed Approximate DBSCAN from `linfa-clustering` due to performance issues. It's now an alias to regular DBSCAN.
* Removed `partitions` dependency, which breaks in current versions of Rust.

Version 0.6.1 - 2022-12-03
========================
New Algorithms
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "linfa"
version = "0.6.1"
version = "0.7.0"
authors = [
"Luca Palmieri <[email protected]>",
"Lorenz Schmidt <[email protected]>",
Expand All @@ -9,7 +9,7 @@ authors = [
]
description = "A Machine Learning framework for Rust"
edition = "2018"
license = "MIT/Apache-2.0"
license = "MIT OR Apache-2.0"

repository = "https://github.com/rust-ml/linfa"
readme = "README.md"
Expand Down
8 changes: 4 additions & 4 deletions algorithms/linfa-bayes/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "linfa-bayes"
version = "0.6.1"
version = "0.7.0"
authors = ["VasanthakumarV <[email protected]>"]
description = "Collection of Naive Bayes Algorithms"
edition = "2018"
license = "MIT/Apache-2.0"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-ml/linfa"
readme = "README.md"
keywords = ["factorization", "machine-learning", "linfa", "unsupervised"]
Expand All @@ -25,8 +25,8 @@ ndarray = { version = "0.15" , features = ["approx"]}
ndarray-stats = "0.5"
thiserror = "1.0"

linfa = { version = "0.6.1", path = "../.." }
linfa = { version = "0.7.0", path = "../.." }

[dev-dependencies]
approx = "0.4"
linfa-datasets = { version = "0.6.1", path = "../../datasets", features = ["winequality"] }
linfa-datasets = { version = "0.7.0", path = "../../datasets", features = ["winequality"] }
12 changes: 6 additions & 6 deletions algorithms/linfa-clustering/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "linfa-clustering"
version = "0.6.1"
version = "0.7.0"
edition = "2018"
authors = [
"Luca Palmieri <[email protected]>",
"xd009642 <[email protected]>",
"Rémi Lafage <[email protected]>"
]
description = "A collection of clustering algorithms"
license = "MIT/Apache-2.0"
license = "MIT OR Apache-2.0"

repository = "https://github.com/rust-ml/linfa/"
readme = "README.md"
Expand Down Expand Up @@ -38,18 +38,18 @@ rand_xoshiro = "0.6"
space = "0.12"
thiserror = "1.0"
#partitions = "0.2.4" This one will break in a future version of Rust and has no replacement
linfa = { version = "0.6.1", path = "../.." }
linfa-nn = { version = "0.6.1", path = "../linfa-nn" }
linfa = { version = "0.7.0", path = "../.." }
linfa-nn = { version = "0.7.0", path = "../linfa-nn" }
noisy_float = "0.2.0"

[dev-dependencies]
ndarray-npy = { version = "0.8", default-features = false }
linfa-datasets = { version = "0.6.1", path = "../../datasets", features = ["generate"] }
linfa-datasets = { version = "0.7.0", path = "../../datasets", features = ["generate"] }
criterion = "0.4.0"
serde_json = "1"
approx = "0.4"
lax = "0.15.0"
linfa = { version = "0.6.0", path = "../..", features = ["benchmarks"] }
linfa = { version = "0.7.0", path = "../..", features = ["benchmarks"] }

[[bench]]
name = "k_means"
Expand Down
8 changes: 4 additions & 4 deletions algorithms/linfa-elasticnet/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "linfa-elasticnet"
version = "0.6.1"
version = "0.7.0"
authors = [
"Paul Körbitz / Google <[email protected]>",
"Lorenz Schmidt <[email protected]>"
]

description = "A Machine Learning framework for Rust"
edition = "2018"
license = "MIT/Apache-2.0"
license = "MIT OR Apache-2.0"

repository = "https://github.com/rust-ml/linfa"
readme = "README.md"
Expand Down Expand Up @@ -37,9 +37,9 @@ num-traits = "0.2"
approx = "0.4"
thiserror = "1.0"

linfa = { version = "0.6.1", path = "../.." }
linfa = { version = "0.7.0", path = "../.." }

[dev-dependencies]
linfa-datasets = { version = "0.6.1", path = "../../datasets", features = ["diabetes", "linnerud"] }
linfa-datasets = { version = "0.7.0", path = "../../datasets", features = ["diabetes", "linnerud"] }
ndarray-rand = "0.14"
rand_xoshiro = "0.6"
23 changes: 16 additions & 7 deletions algorithms/linfa-ftrl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,34 +1,43 @@
[package]
name = "linfa-ftrl"
version = "0.6.1"
version = "0.7.0"
authors = ["Liudmyla Kyrashchuk <[email protected]>"]

description = "A Machine Learning framework for Rust"
edition = "2018"
license = "MIT/Apache-2.0"
license = "MIT OR Apache-2.0"

repository = "https://github.com/rust-ml/linfa"
readme = "README.md"

keywords = ["machine-learning", "linfa", "ai", "ml", "ftrl"]
categories = ["algorithms", "mathematics", "science"]

[features]
serde = ["serde_crate", "linfa/serde", "ndarray/serde", "argmin/serde1"]

[dependencies.serde_crate]
package = "serde"
optional = true
version = "1.0"
features = ["derive"]

[dependencies]
ndarray = { version = "0.15.4", features = ["serde"]}
ndarray-rand = "0.14.0"
argmin = { version = "0.4.7", features = ["ndarray", "ndarray-rand"]}
argmin = { version = "0.8.1", default-features = false }
argmin-math = { version = "0.3", features = ["ndarray_v0_15-nolinalg"] }
thiserror = "1.0"
rand = "0.8.5"
rand_xoshiro = "0.6.0"
serde = {version = "1.0.137", features = ["derive"]}

linfa = { version = "0.6.1", path = "../.."}
linfa = { version = "0.7.0", path = "../.."}

[dev-dependencies]
criterion = "0.4.0"
approx = "0.4"
linfa-datasets = { version = "0.6.1", path = "../../datasets", features = ["winequality"] }
linfa = { version = "0.6.1", path = "../..", features = ["benchmarks"] }
linfa-datasets = { version = "0.7.0", path = "../../datasets", features = ["winequality"] }
linfa = { version = "0.7.0", path = "../..", features = ["benchmarks"] }

[[bench]]
name = "ftrl"
Expand Down
19 changes: 15 additions & 4 deletions algorithms/linfa-ftrl/src/hyperparams.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
use crate::error::FtrlError;
use linfa::{Float, ParamGuard};
use rand::Rng;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[cfg(feature = "serde")]
use serde_crate::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(
feature = "serde",
derive(Serialize, Deserialize),
serde(crate = "serde_crate")
)]
pub struct FtrlParams<F: Float, R: Rng>(pub(crate) FtrlValidParams<F, R>);

/// A verified hyper-parameter set ready for the estimation of a Follow the regularized leader - proximal model
///
/// See [`FtrlParams`](crate::FtrlParams) for more information.
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(
feature = "serde",
derive(Serialize, Deserialize),
serde(crate = "serde_crate")
)]
pub struct FtrlValidParams<F: Float, R: Rng> {
pub(crate) alpha: F,
pub(crate) beta: F,
Expand Down
10 changes: 8 additions & 2 deletions algorithms/linfa-ftrl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ use ndarray::Array1;
use ndarray_rand::RandomExt;
use rand::{distributions::Uniform, Rng};
use rand_xoshiro::{rand_core::SeedableRng, Xoshiro256Plus};
use serde::{Deserialize, Serialize};
#[cfg(feature = "serde")]
use serde_crate::{Deserialize, Serialize};

#[derive(Clone, Debug, Serialize, Deserialize)]
#[derive(Debug, Clone)]
#[cfg_attr(
feature = "serde",
derive(Serialize, Deserialize),
serde(crate = "serde_crate")
)]
pub struct Ftrl<F: Float> {
/// FTRL (Follow The Regularized Leader - proximal) is a linear model for CTR prediction in online learning settings.
/// It stores z and n values, which are later used to calculate weights at incremental model fit and during prediction.
Expand Down
12 changes: 6 additions & 6 deletions algorithms/linfa-hierarchical/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "linfa-hierarchical"
version = "0.6.1"
version = "0.7.0"
authors = ["Lorenz Schmidt <[email protected]>"]
edition = "2018"

description = "Agglomerative Hierarchical clustering"
license = "MIT/Apache-2.0"
license = "MIT OR Apache-2.0"

repository = "https://github.com/rust-ml/linfa"
readme = "README.md"
Expand All @@ -16,12 +16,12 @@ categories = ["algorithms", "mathematics", "science"]
[dependencies]
ndarray = { version = "0.15" }
kodama = "0.2"
thiserror = "=1.0.25"
thiserror = "1.0.25"

linfa = { version = "0.6.1", path = "../.." }
linfa-kernel = { version = "0.6.1", path = "../linfa-kernel" }
linfa = { version = "0.7.0", path = "../.." }
linfa-kernel = { version = "0.7.0", path = "../linfa-kernel" }

[dev-dependencies]
rand = "0.8"
ndarray-rand = "0.14"
linfa-datasets = { version = "0.6.1", path = "../../datasets", features = ["iris"] }
linfa-datasets = { version = "0.7.0", path = "../../datasets", features = ["iris"] }
8 changes: 4 additions & 4 deletions algorithms/linfa-ica/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "linfa-ica"
version = "0.6.1"
version = "0.7.0"
authors = ["VasanthakumarV <[email protected]>"]
description = "A collection of Independent Component Analysis (ICA) algorithms"
edition = "2018"
license = "MIT/Apache-2.0"
license = "MIT OR Apache-2.0"

repository = "https://github.com/rust-ml/linfa"
readme = "README.md"
Expand Down Expand Up @@ -34,13 +34,13 @@ num-traits = "0.2"
rand_xoshiro = "0.6"
thiserror = "1.0"

linfa = { version = "0.6.1", path = "../.." }
linfa = { version = "0.7.0", path = "../.." }

[dev-dependencies]
ndarray-npy = { version = "0.8", default-features = false }
paste = "1.0"
criterion = "0.4.0"
linfa = { version = "0.6.0", path = "../..", features = ["benchmarks"] }
linfa = { version = "0.7.0", path = "../..", features = ["benchmarks"] }

[[bench]]
name = "fast_ica"
Expand Down
8 changes: 4 additions & 4 deletions algorithms/linfa-kernel/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "linfa-kernel"
version = "0.6.1"
version = "0.7.0"
authors = ["Lorenz Schmidt <[email protected]>"]
description = "Kernel methods for non-linear algorithms"
edition = "2018"
license = "MIT/Apache-2.0"
license = "MIT OR Apache-2.0"

repository = "https://github.com/rust-ml/linfa"
readme = "README.md"
Expand All @@ -28,5 +28,5 @@ ndarray = "0.15"
num-traits = "0.2"
sprs = { version="0.11", default-features = false }

linfa = { version = "0.6.1", path = "../.." }
linfa-nn = { version = "0.6.1", path = "../linfa-nn" }
linfa = { version = "0.7.0", path = "../.." }
linfa-nn = { version = "0.7.0", path = "../linfa-nn" }
14 changes: 7 additions & 7 deletions algorithms/linfa-linear/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "linfa-linear"
version = "0.6.1"
version = "0.7.0"
authors = [
"Paul Körbitz / Google <[email protected]>",
"VasanthakumarV <[email protected]>"
]

description = "A Machine Learning framework for Rust"
edition = "2018"
license = "MIT/Apache-2.0"
license = "MIT OR Apache-2.0"

repository = "https://github.com/rust-ml/linfa"
readme = "README.md"
Expand All @@ -32,18 +32,18 @@ ndarray = { version = "0.15", features = ["approx"] }
linfa-linalg = { version = "0.1", default-features = false }
ndarray-linalg = { version = "0.15", optional = true }
num-traits = "0.2"
argmin = { version = "0.7", default-features = false }
argmin-math = { version = "0.2", features = ["ndarray_v0_15-nolinalg"] }
argmin = { version = "0.8.1", default-features = false }
argmin-math = { version = "0.3", features = ["ndarray_v0_15-nolinalg"] }
thiserror = "1.0"

linfa = { version = "0.6.1", path = "../.." }
linfa = { version = "0.7.0", path = "../.." }

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

[[bench]]
name = "ols_bench"
Expand Down
Loading

0 comments on commit 5eefd38

Please sign in to comment.