Compare commits
3 Commits
release-v0.4.8
...
v0.4.9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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/),
|
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).
|
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!
|
- 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`.
|
- `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`.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
name = "smartcore"
|
name = "smartcore"
|
||||||
description = "Machine Learning in Rust."
|
description = "Machine Learning in Rust."
|
||||||
homepage = "https://smartcorelib.org"
|
homepage = "https://smartcorelib.org"
|
||||||
version = "0.4.7"
|
version = "0.4.9"
|
||||||
authors = ["smartcore Developers"]
|
authors = ["smartcore Developers"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|||||||
+1
-1
@@ -166,7 +166,7 @@ pub struct LassoSearchParameters {
|
|||||||
/// The maximum number of iterations
|
/// The maximum number of iterations
|
||||||
pub max_iter: Vec<usize>,
|
pub max_iter: Vec<usize>,
|
||||||
#[cfg_attr(feature = "serde", serde(default))]
|
#[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>,
|
pub fit_intercept: Vec<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ impl<T: FloatNumber, X: Array2<T>> InteriorPointOptimizer<T, X> {
|
|||||||
let lambda = lambda.max(T::epsilon());
|
let lambda = lambda.max(T::epsilon());
|
||||||
|
|
||||||
//parameters
|
//parameters
|
||||||
|
let max_ls_iter = 100;
|
||||||
let pcgmaxi = 5000;
|
let pcgmaxi = 5000;
|
||||||
let min_pcgtol = T::from_f64(0.1).unwrap();
|
let min_pcgtol = T::from_f64(0.1).unwrap();
|
||||||
let eta = T::from_f64(1E-3).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()
|
y.to_owned()
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut max_ls_iter = 100;
|
|
||||||
let mut pitr = 0;
|
let mut pitr = 0;
|
||||||
let mut w = Vec::zeros(p);
|
let mut w = Vec::zeros(p);
|
||||||
let mut neww = w.clone();
|
let mut neww = w.clone();
|
||||||
@@ -170,7 +170,7 @@ impl<T: FloatNumber, X: Array2<T>> InteriorPointOptimizer<T, X> {
|
|||||||
s = T::one();
|
s = T::one();
|
||||||
let gdx = grad.dot(&dxu);
|
let gdx = grad.dot(&dxu);
|
||||||
|
|
||||||
let lsiter = 0;
|
let mut lsiter = 0;
|
||||||
while lsiter < max_ls_iter {
|
while lsiter < max_ls_iter {
|
||||||
for i in 0..p {
|
for i in 0..p {
|
||||||
neww[i] = w[i] + s * dx[i];
|
neww[i] = w[i] + s * dx[i];
|
||||||
@@ -195,7 +195,7 @@ impl<T: FloatNumber, X: Array2<T>> InteriorPointOptimizer<T, X> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
s = beta * s;
|
s = beta * s;
|
||||||
max_ls_iter += 1;
|
lsiter += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if lsiter == max_ls_iter {
|
if lsiter == max_ls_iter {
|
||||||
|
|||||||
Reference in New Issue
Block a user