--- id: glum version: "3.4.1" license: BSD license_treatment: permissive maintenance: active --- # glum — High performance Python GLMs with all the features! License: permissive · Maintenance: active · Downloads: 330.9K/mo ## What it is and what it does glum is a scikit-learn-compatible GLM library designed for speed and statistical completeness. It supports Normal, Poisson, binomial, gamma, inverse Gaussian, negative binomial, and Tweedie distributions with customizable link functions. The library includes L1, L2, and elastic net regularization, built-in cross-validation for regularization tuning, and classical statistical inference for unregularized models. It also supports box constraints, linear inequality constraints, sample weights, and offsets. The package emphasizes formula-based model specification via formulaic, allowing users to define models with intuitive syntax including monotonic constraints. It works with multiple dataframe backends (pandas, polars, and others) through narwhals. Performance is a core design goal—the library is optimized for scenarios where observations greatly outnumber predictors, and includes benchmarking tools for comparison against other modern libraries. Use it for: - Build logistic regression models with L1 regularization for sparse, interpretable solutions in classification tasks - Fit Poisson regression for count data in demand forecasting or event prediction - Specify complex models with formulas including spline basis functions and categorical encoding without manual feature engineering - Apply Tikhonov (matrix-valued) penalties to model correlated random effects in hierarchical data - Perform statistical inference on unregularized GLM coefficients with confidence intervals and hypothesis tests - Benchmark GLM fitting performance across libraries using the included glum_benchmarks module ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. glum is a high-performance Python library for fitting generalized linear models (GLMs) with support for multiple distributions, regularization methods, formula-based specification, and statistical inference. Yes, if you need fast GLM fitting with broad distribution and regularization support and a scikit-learn-like API. The active maintenance, permissive license, and zero known vulnerabilities make it production-ready. Medium install friction is acceptable for the performance and feature gains. Verify performance on your specific problem size and distribution before committing to production use. ## Install pip install glum uv add glum poetry add glum ## Installing glum Before you install: Medium install friction due to compiled wheels across multiple Python versions (3.10–3.13) and architectures. Active maintenance with recent releases; last commit 2026-08-03. Twelve runtime dependencies including numpy, scipy, scikit-learn, pandas, and pyarrow add some complexity, though all are widely available. License in practice: BSD permissive license allows commercial and private use with minimal restrictions, making it suitable for most production and research contexts. Quickstart: pip install glum from glum import GeneralizedLinearRegressor import pandas as pd model = GeneralizedLinearRegressor(family='binomial', alpha=0.001) model.fit(X, y) predictions = model.predict(X_test) Requires Python 3.10 or later. For optimal performance on x86_64, MKL library recommended (conda install mkl). Verify before relying: - Specific performance gains versus scikit-learn or other GLM libraries on typical datasets - Memory usage characteristics for large datasets - Whether all documented distributions (Tweedie, negative binomial, etc.) are production-ready ## Package facts - License: BSD (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 330.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags generalized linear models python, GLM regression library, logistic regression with regularization, poisson regression python, fast GLM fitting, formula-based model specification, L1 L2 elastic net regularization, statistical-modeling, regularization, formula-based [View on SkillFed](https://skillfed.io/packages/glum) · [View on PyPI](https://pypi.org/project/glum/)