Skip to content

Releases: KamitaniLab/PyFastL2LiR

PyFastL2LiR 0.11 Release

Choose a tag to compare

@ganow ganow released this 21 May 06:45

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 matrix X, 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)

  • Python 3.10+ compatibility fix. The previous version compared float(f"{major}.{minor}"), which evaluated 3.10 as 3.1 and incorrectly rejected threadpoolctl on Python 3.10 and later. The check now compares major/minor as integers. (PR #7, fixes #6)

Bug fixes

  • Python version comparison no longer misidentifies 3.10+ as older than 3.5 (#6, PR #7).

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.py to pyproject.toml (PEP 621 metadata, uv_build build backend).
  • Switched to the src layout: fastl2lir/src/fastl2lir/.
  • Added a py.typed marker (PEP 561) so downstream type checkers pick up the package as typing-aware.
  • threadpoolctl is now declared as a proper conditional dependency in pyproject.toml instead of being assumed present.
  • Test directory renamed test/tests/, and the top-level test.py moved to tests/test_fastl2lir.py.
  • Added project URLs (Homepage, Repository, Bug Tracker) to package metadata. (PR #8)

Tests

  • New test_nfeat_no_feature_selection_wide exercises 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_selection as 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.py to pyproject.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