4 Commits

Author SHA1 Message Date
dependabot[bot]
ff9679c970 Update rand requirement from 0.8.5 to 0.9.2
Updates the requirements on [rand](https://github.com/rust-random/rand) to permit the latest version.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/0.8.5...rand_core-0.9.2)

---
updated-dependencies:
- dependency-name: rand
  dependency-version: 0.9.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-19 17:02:08 +00:00
Lorenzo Mec-iS
c57a4370ba bump version tp 0.4.9 2026-01-09 06:14:44 +00:00
Georeth Chow
78f18505b1 fix LASSO (#346)
* fix lasso doc typo
* fix lasso optimizer bug
2025-12-05 17:49:07 +09:00
Lorenzo
58a8624fa9 v0.4.8 (#345) 2025-11-29 02:54:35 +00:00
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [0.4.8] - 2025-11-29
- WARNING: Breaking changes!
- `LassoParameters` and `LassoSearchParameters` have a new field `fit_intercept`. When it is set to false, the `beta_0` term in the formula will be forced to zero, and `intercept` field in `Lasso` will be set to `None`.
+2 -2
View File
@@ -2,7 +2,7 @@
name = "smartcore"
description = "Machine Learning in Rust."
homepage = "https://smartcorelib.org"
version = "0.4.7"
version = "0.4.9"
authors = ["smartcore Developers"]
edition = "2021"
license = "Apache-2.0"
@@ -25,7 +25,7 @@ cfg-if = "1.0.0"
ndarray = { version = "0.15", optional = true }
num-traits = "0.2.12"
num = "0.4"
rand = { version = "0.8.5", default-features = false, features = ["small_rng"] }
rand = { version = "0.9.2", default-features = false, features = ["small_rng"] }
rand_distr = { version = "0.4", optional = true }
serde = { version = "1", features = ["derive"], optional = true }
ordered-float = "5.1.0"
+1 -1
View File
@@ -166,7 +166,7 @@ pub struct LassoSearchParameters {
/// The maximum number of iterations
pub max_iter: Vec<usize>,
#[cfg_attr(feature = "serde", serde(default))]
/// The maximum number of iterations
/// If false, force the intercept parameter (beta_0) to be zero.
pub fit_intercept: Vec<bool>,
}
+3 -3
View File
@@ -53,6 +53,7 @@ impl<T: FloatNumber, X: Array2<T>> InteriorPointOptimizer<T, X> {
let lambda = lambda.max(T::epsilon());
//parameters
let max_ls_iter = 100;
let pcgmaxi = 5000;
let min_pcgtol = T::from_f64(0.1).unwrap();
let eta = T::from_f64(1E-3).unwrap();
@@ -68,7 +69,6 @@ impl<T: FloatNumber, X: Array2<T>> InteriorPointOptimizer<T, X> {
y.to_owned()
};
let mut max_ls_iter = 100;
let mut pitr = 0;
let mut w = Vec::zeros(p);
let mut neww = w.clone();
@@ -170,7 +170,7 @@ impl<T: FloatNumber, X: Array2<T>> InteriorPointOptimizer<T, X> {
s = T::one();
let gdx = grad.dot(&dxu);
let lsiter = 0;
let mut lsiter = 0;
while lsiter < max_ls_iter {
for i in 0..p {
neww[i] = w[i] + s * dx[i];
@@ -195,7 +195,7 @@ impl<T: FloatNumber, X: Array2<T>> InteriorPointOptimizer<T, X> {
}
}
s = beta * s;
max_ls_iter += 1;
lsiter += 1;
}
if lsiter == max_ls_iter {