# lmfit/lmfit-py

Non-Linear Least Squares Minimization, with flexible Parameter settings, based on scipy.optimize, and with many additional classes and methods for curve fitting.

Repository: https://github.com/lmfit/lmfit-py
Canonical: https://ross.abutalabs.com/products/lmfit-py
Homepage: https://lmfit.github.io/lmfit-py/
Language: Python
License: NOASSERTION
License Family: other
Topics: python, scipy, curve-fitting, least-squares
Last push: 2026-08-03T12:48:00+00:00

## Health v2 (maintenance only)
Score: 68/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 95, release rhythm 16, longevity 100
- inputs: {"age_days": 5511, "days_push": 30, "days_rel": 410, "gap_med": 129, "n_releases_24m": 2}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1231, forks 296 (observed 2026-08-28T04:04:04.322485+00:00)

## What it is
lmfit is a pure Python library built on SciPy and NumPy for non-linear least-squares minimization and curve fitting. It wraps scipy.optimize with named Parameter objects that support bounds, fixed values, algebraic constraints, and uncertainty estimation.

## Use cases
- fit a curve to experimental data with nonlinear least squares
- fit a model with bounded and constrained parameters
- estimate parameter uncertainties and confidence intervals after a fit
- switch fitting algorithms without rewriting the objective function
- fit peak models like Gaussian and Lorentzian to spectra
- constrain one fit parameter as an expression of others

## When to choose
- you need curve fitting or nonlinear optimization with named, bounded, or constrained parameters
- you want better confidence interval estimation than raw scipy.optimize provides
- you want a high-level Model API for common fitting shapes

## When to avoid
- you need linear regression or simple polynomial fits where numpy.polyfit suffices
- you need general-purpose global optimization unrelated to least squares
- you need machine-learning model training rather than scientific curve fitting

## Facets
- artifact type: library
- maturity: stable
- function: math, data-science
- domain: data-science
- platform: python, cross-platform
- tags: curve-fitting, least-squares, optimization, scipy, parameter-estimation, confidence-intervals, algorithms, scientific-computing

## Member repositories
- lmfit/lmfit-py (main) score 68

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:04.322485+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T08:22:30.622029+00:00, confidence not recorded.
  - readme: https://github.com/lmfit/lmfit-py (fetched 2026-08-28T04:04:04.322485+00:00, sha 3d31f9910dc9)
  - homepage: https://lmfit.github.io/lmfit-py/ (fetched 2026-08-29T12:22:30.973191+00:00, sha d09e5ef5c6b7)
- Data as of 2026-08-30T08:39:29.467469+00:00.
