Skip to content

2.0.0

Choose a tag to compare

@Hugo-W Hugo-W released this 25 Aug 15:12
· 32 commits to main since this release
24325df

v2.0.0 — Solver Pattern Abstraction

Breaking changes

  • None — full backward compatibility preserved. All existing and free-function (, , etc.) APIs work unchanged.

New features

  • Solver Pattern abstraction (issue #12): abstract base class with 5 concrete subclasses:
    • — SVD-based ridge regression (the main workhorse)
    • — ordinary least squares
    • — CG on normal equations (10–50x faster than SVD with identical results)
    • — robust Cauchy-loss IRLS (downweights outliers)
    • — SciPy nonlinear Cauchy (reference validator)
  • Dependency injection: accepts any instance
  • Compatibility guards: warns when robust loss is used with a non-robust solver; raises when non-SVD solver is used with multi-alpha arrays
  • 22 new tests for the Solver API (177 total, zero regressions)

Example

from pyeeg.solvers import ConjugateGradientSolver, IRLSSolver
from pyeeg import TRFEstimator

# Fast iterative solver
trf = TRFEstimator(alpha=100.0, solver=ConjugateGradientSolver())

# Robust fitting
trf = TRFEstimator(alpha=100.0, solver=IRLSSolver(max_iter=50))

See scripts/examples/solver_showcase.py for a full comparison.

PyPI

https://pypi.org/project/natmeeg/2.0.0/