You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(lda): address review follow-ups from #456 (#457)
* fix(lda): address review follow-ups from #456
- Singularity threshold: T::epsilon() → relative tolerance (1e-4 * l_max), matching sklearn
- PartialEq: T::epsilon() → fixed 1e-10 tolerance for float comparison
- Rename field scalings → projection_matrix to avoid shadowing the public getter
- Add missing test coverage: X/y mismatch, zero n_components, wrong transform features
- Remove polyfill.io script tag (supply-chain concerns)
- Add blank line between lda and pca module declarations in mod.rs
- Bump version to 0.6.14 and move CHANGELOG entry accordingly
* fix(lda): raise PartialEq tolerance from 1e-10 to 1e-6 for f32 safety
1e-10 rounds to 0.0 in f32 (min positive normal ~1.2e-7), making
(a - b).abs() > 0.0 almost always true for distinct values. The 1e-6
floor works correctly for both f32 and f64.
Addresses review feedback on #457.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,11 @@ All notable changes to this project will be documented in this file.
4
4
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
7
-
## [0.6.13]
7
+
## [0.6.14]
8
8
### Added
9
9
-`decomposition/lda.rs`: `LDA`, linear discriminant analysis for supervised dimensionality reduction (#136). It projects the data onto the directions that best separate the classes, keeping `min(n_classes - 1, n_features)` components by default, and implements the `Transformer` interface next to `PCA`. Directions match scikit-learn's `LinearDiscriminantAnalysis(solver="eigen")` up to sign.
10
10
11
-
## [0.6.12]
11
+
## [0.6.13]
12
12
### Fixed
13
13
-`xgboost/xgb_regressor.rs`: `XGRegressor::fit` no longer panics when `subsample` is less than 1.0 on a small dataset (#444). The sample for each tree now keeps a minimum of one row, as scikit-learn does for its own `subsample` parameter. Sample sizes of one row or more are unchanged.
Copy file name to clipboardExpand all lines: src/decomposition/lda.rs
+38-12Lines changed: 38 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,6 @@
43
43
//! * ["An Introduction to Statistical Learning", James G., Witten D., Hastie T., Tibshirani R., 4.4 Linear Discriminant Analysis](http://faculty.marshall.usc.edu/gareth-james/ISL/)
0 commit comments