Metadata-Version: 2.4
Name: easy_glm
Version: 0.462
Summary: LASSO-regularised GLMs for insurance pricing: exact rate tables, a browser workbench and a portable scoring model. Built on glum.
Author-email: Serban Dragne <sadragne@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/serband/easy_glm
Project-URL: Repository, https://github.com/serband/easy_glm
Project-URL: Issues, https://github.com/serband/easy_glm/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: <3.15,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: polars>=1.17.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: pyarrow>=14.0.0
Requires-Dist: glum<3.5,>=3.4.0
Requires-Dist: tabmat>=4.0.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: rdata>=0.9.0
Requires-Dist: joblib>=1.0.0
Requires-Dist: xlsxwriter>=3.0.0
Requires-Dist: fastapi<1,>=0.115
Requires-Dist: uvicorn<1,>=0.30
Requires-Dist: fastexcel>=0.12.0
Requires-Dist: streamlit>=1.45.0
Requires-Dist: plotly>=5.15.0
Requires-Dist: matplotlib>=3.7.0
Requires-Dist: seaborn>=0.12.0
Provides-Extra: desktop
Provides-Extra: dev
Requires-Dist: fastexcel>=0.12.0; extra == "dev"
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: httpx<1,>=0.27; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.8.0; extra == "dev"
Requires-Dist: jupyter>=1.0.0; extra == "dev"
Requires-Dist: ipykernel>=6.0.0; extra == "dev"
Requires-Dist: build>=0.10.0; extra == "dev"
Requires-Dist: twine>=4.0.0; extra == "dev"
Provides-Extra: benchmark
Requires-Dist: statsmodels>=0.14.0; extra == "benchmark"
Requires-Dist: catboost>=1.2.0; extra == "benchmark"
Dynamic: license-file

# EasyGLM

Fit insurance pricing GLMs, check model performance and export rating tables
from a local browser workbench.

## Install and open

Requires Python 3.10–3.14. Run in a terminal:

```bash
pip install --upgrade easy_glm
easy-glm-workbench
```

Your browser opens automatically. Keep the terminal open while you work.
Restart the workbench after upgrading.

## Build a model

1. **Load data.** Open your file or try the French motor claim-frequency or
   Swedish motorcycle claim-cost example. Supports CSV, Parquet, Excel,
   Arrow/Feather and SAS files.
2. **Choose variables.** Set the target, exposure/weight and predictors. Check
   for missing data, possible leakage and redundant predictors before fitting.
3. **Explore.** See observed rates and exposure by variable.
4. **Fit.** Choose a model family, training/holdout split, factor shapes and
   interactions, then click **Fit model**.
5. **Review.** Check actual versus expected, lift, Gini and variable importance.
   Compare alternative models.
6. **Adjust.** Smooth, cap/floor or edit relativities, then apply your changes.
   The original fit stays available for comparison.

Supports Poisson, Gamma, Tweedie, Gaussian, binomial and inverse Gaussian GLMs,
with regularisation and two-stage interactions.

![Model design in EasyGLM](docs/images/workbench-model-design.png)

## Export and keep your work

| Export | What you get |
| --- | --- |
| Excel | Applied rating tables |
| Scorer (`.easyglm`) | Applied rates for scoring new data |
| Project JSON | Model setup, applied adjustments and named snapshots |
| HTML report | Data summaries, importance, coefficient paths, rating factors and diagnostics |
| Python script | Reproduce the model from its source data |

Before closing, save the **project JSON** and **scorer**. Reopening a project
requires its source data and a refit; fitted runs and session Undo are not saved
in project JSON.

## Already working in Python?

Open a pandas or Polars dataframe in the workbench:

```python skip-test
import easy_glm

easy_glm.launch_workbench(data=df)
```

[Workbench walkthrough](examples/workbench_walkthrough.md) ·
[Python examples](examples/README.md) · [Changelog](CHANGELOG.md)

## Why I built this

This started with my wish to port R's [aglm](https://CRAN.R-project.org/package=aglm)
to Python and give it a GUI. It's built primarily for my own pricing work and will
probably have plenty of bugs, because… vibecode yo. Check the results before
using them.

[MIT licence](LICENSE).
