Releases: KamitaniLab/PyFastL2LiR
Release list
PyFastL2LiR 0.11 Release
PyFastL2LiR 0.11
This release introduces an automatic primal/dual ridge solver that supports wide data in the no-feature-selection path, fixes a Python 3.10+ compatibility issue, and modernizes the project's packaging and layout.
Highlights
-
Automatic primal/dual solver for
FastL2LiR.fit(..., n_feat=0). The solver picks between two closed-form ridge solutions based on the shape of the (augmented) design matrixX, always choosing the side that yields the smaller linear system:- tall (
n_samples > n_features) → primal form:(XᵀX + αI_p)⁻¹ XᵀY - wide (
n_samples ≤ n_features) → dual form:Xᵀ (XXᵀ + αI_n)⁻¹ Y
This is fully automatic — no API change is required. Results are numerically equivalent between the two forms. (PR #7 + #9, fixes #6)
- tall (
-
Python 3.10+ compatibility fix. The previous version compared
float(f"{major}.{minor}"), which evaluated3.10as3.1and incorrectly rejectedthreadpoolctlon Python 3.10 and later. The check now compares major/minor as integers. (PR #7, fixes #6)
Bug fixes
Packaging & project layout
These changes are mostly transparent to users installing from PyPI / source, but contributors and downstream packagers should be aware:
- Migrated from
setup.pytopyproject.toml(PEP 621 metadata,uv_buildbuild backend). - Switched to the src layout:
fastl2lir/→src/fastl2lir/. - Added a
py.typedmarker (PEP 561) so downstream type checkers pick up the package as typing-aware. threadpoolctlis now declared as a proper conditional dependency inpyproject.tomlinstead of being assumed present.- Test directory renamed
test/→tests/, and the top-leveltest.pymoved totests/test_fastl2lir.py. - Added project URLs (Homepage, Repository, Bug Tracker) to package metadata. (PR #8)
Tests
- New
test_nfeat_no_feature_selection_wideexercises the wide-matrix (more features than samples) path and validates the dual-form branch against a reference output (tests/testdata_wide.npz). - Clarified the existing
test_nfeat_no_feature_selectionas the tall-matrix (more samples than features) / primal-form counterpart.
Contributing
A new CONTRIBUTING.md documents the development workflow: uv sync for environment setup, branch naming conventions, pytest for tests, and ruff for lint/format.
Pull requests included
- #7 + #9 — Automatic primal/dual ridge solver (fixes #6) (@KenyaOtsuka)
- #8 — Migrate packaging from
setup.pytopyproject.toml(@ganow)
Compatibility
No public API changes. Existing code using FastL2LiR(...).fit(...) / .predict(...) continues to work unchanged; the dual/primal selection is handled internally.
Full Changelog: 0.10...0.11