Welcome to ezfit’s documentation!¶
ezfit is a dead simple interface for fitting in Python, designed for people who are new not just to Python but to coding, fitting, and programmatically interacting with data.
Note
If you have experience with Excel but need to fit data using least squares fitting, this is the tool for you!
Quick Start¶
import pandas as pd
import ezfit
# Load your data
df = pd.read_csv("data.csv")
# Define a simple model
def line(x, m, b):
return m * x + b
# Fit the data
model, ax, _ = df.fit(line, "x", "y", "yerr")
# View results
print(model)
Installation¶
pip install ezfit
Or with optional dependencies for MCMC:
pip install ezfit[mcmc]
Features¶
Simple API: Fit dataframes directly with a clean, intuitive interface
Multiple Optimizers: Choose from scipy optimizers, scikit-learn methods, or MCMC
Parameter Constraints: Specify parameter relationships and bounds easily
MCMC Diagnostics: Built-in convergence diagnostics and visualization
Beautiful Plots: Automatic plotting with residuals and model visualization