File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,12 @@ Fixed models
43
43
between sparse and dense input. :pr: `21195 `
44
44
by :user: `Jérémie du Boisberranger <jeremiedbb> `.
45
45
46
+ :mod: `sklearn.linear_model `
47
+ ...........................
48
+
49
+ - |Fix | Improves stability of :class: `linear_model.LassoLars ` for different
50
+ versions of openblas. :pr: `21340 ` by `Thomas Fan `_.
51
+
46
52
:mod: `sklearn.neighbors `
47
53
........................
48
54
@@ -677,7 +683,7 @@ Changelog
677
683
Dupre la Tour `_.
678
684
679
685
- |Fix | Decrease the numerical default tolerance in the lobpcg call
680
- in :func: `manifold.spectral_embedding ` to prevent numerical instability.
686
+ in :func: `manifold.spectral_embedding ` to prevent numerical instability.
681
687
:pr: `21194 ` by :user: `Andrew Knyazev <lobpcg> `.
682
688
683
689
:mod: `sklearn.metrics `
Original file line number Diff line number Diff line change @@ -544,6 +544,7 @@ def _lars_path_solver(
544
544
sys .stdout .flush ()
545
545
546
546
tiny32 = np .finfo (np .float32 ).tiny # to avoid division by 0 warning
547
+ cov_precision = np .finfo (Cov .dtype ).precision
547
548
equality_tolerance = np .finfo (np .float32 ).eps
548
549
549
550
if Gram is not None :
@@ -726,6 +727,10 @@ def _lars_path_solver(
726
727
# orthogonal (QR) decomposition of X
727
728
corr_eq_dir = np .dot (Gram [:n_active , n_active :].T , least_squares )
728
729
730
+ # Explicit rounding can be necessary to avoid `np.argmax(Cov)` yielding
731
+ # unstable results because of rounding errors.
732
+ np .around (corr_eq_dir , decimals = cov_precision , out = corr_eq_dir )
733
+
729
734
g1 = arrayfuncs .min_pos ((C - Cov ) / (AA - corr_eq_dir + tiny32 ))
730
735
if positive :
731
736
gamma_ = min (g1 , C / AA )
You can’t perform that action at this time.
0 commit comments