Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4db94badbd | ||
|
|
c57a4370ba | ||
|
|
78f18505b1 | ||
|
|
58a8624fa9 |
+1
-1
@@ -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
@@ -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"
|
||||
@@ -51,7 +51,7 @@ wasm-bindgen-test = "0.3"
|
||||
[dev-dependencies]
|
||||
itertools = "0.13.0"
|
||||
serde_json = "1.0"
|
||||
bincode = "1.3.1"
|
||||
bincode = "3.0.0"
|
||||
|
||||
[workspace]
|
||||
|
||||
|
||||
+1
-1
@@ -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>,
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user