New feature:
- :class:`~glum.GeneralizedLinearRegressorCV` now exposes
train_deviance_path_, an array of shape(n_folds, n_l1_ratios, n_alphas)with the training-set deviance.
Other changes:
- Replaced the
hess="2-point"finite-difference Hessian in thetrust-constrsolver withSR1()(quasi-Newton), significantly speeding up convergence when the number of features is large relative to the number of rows.
Bug fix:
- Fixed incorrect call in :meth:`~glum.InverseGaussianDistribution.log_likelihood`. The previous implementation always returned NaN.
Bug fix:
- Fixed incorrect formula in :meth:`~glum.CloglogLink.inverse_derivative2`. This affected observed information matrix computation and robust/clustered standard errors for models using the complementary log-log link.
Bug fix:
- Fixed an error when predicting at a specific
alphawith categorical features.
Other changes:
- Downgraded log messages in
align_df_categoriesandadd_missing_categoriesfrom INFO to DEBUG, and deduplicated them so they are emitted only once per column per fitted model.
New features:
- Add
solver="closed-form"for Gaussian identity-link models, using an analytical normal-equations solution for ridge/OLS, auto-selecting it undersolver="auto"for unconstrained no-L1 cases, and falling back to least-squares for singular or ill-conditioned systems. - :class:`~glum.GeneralizedLinearRegressor` and :class:`~glum.GeneralizedLinearRegressorCV` now accept Polars DataFrames as input, in addition to pandas DataFrames and numpy arrays.
Bug fixes:
- Fixed
predict(X, alpha_index=...)andpredict(X, alpha=...)on :class:`~glum.GeneralizedLinearRegressorCV`, which previously raised an error. The CV estimator now refits on the full data over the entire alpha path for the bestl1_ratio_. - Fixed alpha path computation in :class:`~glum.GeneralizedLinearRegressorCV`: the alpha grid is now computed from the properly standardized feature matrix and per-feature
P1penalties (matching the base class), and accounts foroffsetwhen present.
Bug fixes:
- Fixed
deviance_path_in :class:`~glum.GeneralizedLinearRegressorCV` being scaled down by a factor ofn_foldsbecause test fold weights were not normalized to sum to 1. - Fixed :class:`~glum.NegativeBinomialDistribution`
thetasetter rejectingnp.numbertypes, causingdist.theta = dist.thetato raise aTypeError.
Other changes:
- We disabled fast math to avoid invalid results (e.g., when dividing by zero).
- The default
alpha_maxfor the regularization path in the pure ridge case (l1_ratio=0) is now computed from the null model gradient, matching glmnet's behavior. Previously it was hardcoded to 10. - When
min_alpha_ratiois not set andn_samples < n_features, the default is now1e-2instead of1e-6, matching glmnet's convention.
Other changes:
- Linux-aarch64 wheels are now uploaded to PyPI.
Bug fixes:
- Fixed a bug where :meth:`~glum.TweedieDistribution._rowwise_gradient_hessian` and :meth:`~glum.TweedieDistribution._eta_mu_deviance` would call functions with wrong arguments in the
p = 3case. - Fixed :class:`glum.InverseGaussianDistribution` not using the optimized gradient, Hessian and deviance implementations, as well as those derivatives having the wrong sign.
Other changes:
- Build and test with Python 3.13 in CI.
New features:
- New argument
max_inner_iterfor classes :class:`~glum.GeneralizedLinearRegressor` and :class:`~glum.GeneralizedLinearRegressorCV` to control the maximum number of iterations of the inner solver in the IRLS-CD algorithm. - New fitted attributes
col_means_andcol_stds_for classes :class:`~glum.GeneralizedLinearRegressor` and :class:`~glum.GeneralizedLinearRegressorCV`. - :class:`~glum.GeneralizedLinearRegressor` now prints more informative logs when fitting with
alpha_search=Trueandverbose=True.
Bug fixes:
- Fixed a bug where :meth:`glum.GeneralizedLinearRegressor.fit` would raise a
dtypemismatch error if fit withalpha_search=True. - Use data type (
float64orfloat32) dependent precision in solvers.
**Other changes:
- Lower absolute tolerance when matching the
alphaargument in :meth:`glum.GeneralizedLinearRegressor.predict` to thealphasused in training whenalpha_search=True.
Bug fix:
- Fixed :meth:`~glum.GeneralizedLinearRegressor.wald_test` when using
termsand no intercept.
Other changes:
- Moved the development infrastructure to pixi.
- Moved the linting and formatting to ruff.
- Removed libblas MKL from the development environment.
- Replaced deprecated 'oldest-supported-numpy' dependency with 'numpy' to support 2.0 release.
Bug fix:
- We now support scikit-learn 1.5.
Breaking changes:
- All arguments to :class:`~glum.GeneralizedLinearRegressorBase`, :class:`~glum.GeneralizedLinearRegressor` and :class:`GeneralizedLinearRegressorCV` are now keyword-only.
- All arguments to public methods of :class:`~glum.GeneralizedLinearRegressorBase`, :class:`~glum.GeneralizedLinearRegressor` or :class:`GeneralizedLinearRegressorCV` except
X,y,sample_weightandoffsetare now keyword-only. - :class:`~glum.GeneralizedLinearRegressor`'s default value for
alphais now0, i.e. no regularization. - :class:`~glum.GammaDistribution`, :class:`~glum.InverseGaussianDistribution`, :class:`~glum.NormalDistribution` and :class:`~glum.PoissonDistribution` no longer inherit from :class:`~glum.TweedieDistribution`.
- The power parameter of :class:`~glum.TweedieLink` has been renamed from
ptopower, in line with :class:`~glum.TweedieDistribution`. - :class:`~glum.TweedieLink` no longer instantiates :class:`~glum.IdentityLink` or :class:`~glum.LogLink` for
power=0andpower=1, respectively. On the other hand, :class:`~glum.TweedieLink` is now compatible withpower=0andpower=1.
New features:
- Added a formula interface for specifying models.
- Improved feature name handling. Feature names are now created for non-pandas input matrices too. Furthermore, the format of categorical features can be specified by the user.
- Term names are now stored in the model's attributes. This is useful for categorical features, where they refer to the whole variable, not just single levels.
- Added more options for treating missing values in categorical columns. They can either raise a
ValueError("fail"), be treated as all-zero indicators ("zero") or represented as a new category ("convert"). - meth:GeneralizedLinearRegressor.wald_test can now perform tests based on a formula string and term names.
- :class:`~glum.InverseGaussianDistribution` gains a :meth:`~glum.InverseGaussianDistribution.log_likelihood` method.
Bug fix:
- Added cython compiler directive legacy_implicit_noexcept = True to fix performance regression with cython 3.
Other changes:
- Require Python>=3.9 in line with NEP 29 <https://numpy.org/neps/nep-0029-deprecation_policy.html#support-table>.
- Build and test with Python 3.12 in CI.
- Added line search stopping criterion for tiny loss improvements based on gradient information.
- Added warnings about breaking changes in future versions.
New features:
- Added the complementary log-log (
cloglog) link function. - Added the option to store the covariance matrix after estimating it. In this case, the covariance matrix does not have to be recomputed when calling inference methods.
- Added methods for performing Wald tests based on a restriction matrix, feature names or term names.
- Added a method for creating a coefficient table with confidence intervals and p-values.
Bug fix:
- Fixed :meth:`~glum.GeneralizedLinearRegressorBase.covariance_matrix` mutating feature names when called with a data frame. See here.
Other changes:
- When computing the covariance matrix, check whether the design matrix is ill-conditioned for all types of input. Furthermore, do it in a more efficient way.
- Pin
tabmat<4.0.0(the new release will bring breaking changes).
Bug fix
- Fix the
glm_benchmarks_analyzecommand line tool. See here. - Fixed a bug in :class:`~glum.GeneralizedLinearRegressor` when fit on a data set with a constant column and
warm_start=True. See here.
Other changes:
- Remove dev dependency on
dask_ml. - We now pin
llvm-openmp=11when creating the wheel for macOS in line with what scikit-learn does.
Other changes:
- Better error message when the number of input features is different between the fit and predict methods.
Bug fix:
- We fixed a bug in the computation of :meth:`~glum.distribution.NegativeBinomialDistribution.log_likelihood`. Previously, this method just returned
None.
New feature:
- Added Negative Binomial distribution by setting the
'family'parameter of :class:`~glum.GeneralizedLinearRegressor` and :class:`~glum.GeneralizedLinearRegressorCV` to'negative.binomial'.
Bug fixes:
- Fixed an issue with :meth:`~glum.ExponentialDispersionModel._score_matrix` which failed when called with a tabmat matrix input.
Other changes:
- Removes unused scikit-learn cython imports.
Other changes:
- :class:`~glum._link.LogitLink` has been made public.
- Apple Silicon wheels are now uploaded to PyPI.
Bug fixes:
- A data frame with dense and sparse columns was transformed to a dense matrix instead of a split matrix by :meth:`~glum.GeneralizedLinearRegressor._set_up_and_check_fit_args`.
Fixed by calling
tabmat.from_pandason any data frame.
New features:
- The following classes and functions have been made public: :class:`~glum._distribution.BinomialDistribution`, :class:`~glum._distribution.ExponentialDispersionModel`, :class:`~glum._distribution.GammaDistribution`, :class:`~glum._distribution.GeneralizedHyperbolicSecant`, :class:`~glum._distribution.InverseGaussianDistribution`, :class:`~glum._distribution.NormalDistribution`, :class:`~glum._distribution.PoissonDistribution`, :class:`~glum._link.IdentityLink`, :class:`~glum._link.Link`, :class:`~glum._link.LogLink`, :class:`~glum._link.TweedieLink`, :func:`~glum._glm.get_family` and :func:`~glum._glm.get_link`.
- The distribution and link classes now feature a more lenient equality check instead of the default identity check,
so that, e.g.,
TweedieDistribution(1) == TweedieDistribution(1)now returnsTrue.
Other changes:
- Fixing pypi upload issue. Version 2.2.0 will not be available through the standard distribution channels.
New features:
- Add an argument to GeneralizedLinearRegressorBase to drop the first category in a Categorical column using [implementation in tabmat](Quantco/tabmat#168)
- One may now request the Tweedie loss by setting the
'family'parameter of :class:`~glum.GeneralizedLinearRegressor` and :class:`~glum.GeneralizedLinearRegressorCV` to'tweedie'.
Bug fixes:
- Setting bounds for constant columns was not working (bounds were internally modified to 0). A similar issue was preventing inequalities from working with constant columns. This is now fixed.
Other changes:
- No more builds for 32-bit systems with python >= 3.8. This is due to scipy not supporting it anymore.
Other changes:
- Next attempt to build wheel for PyPI without
--march=native.
Other changes:
- We are now building the wheel for PyPI without
--march=nativeto make it more portable across architectures.
New features:
- Added :meth:`aic`, :meth:`aicc` and :meth:`bic` attributes to the :class:`~glum.GeneralizedLinearRegressor`. These attributes provide the information criteria based on the training data and the effective degrees of freedom of the maximum likelihood estimate for the model's parameters.
- :meth:`~glum.GeneralizedLinearRegressor.std_errors` and :meth:`~glum.GeneralizedLinearRegressor.covariance_matrix` of :class:`~glum.GeneralizedLinearRegressor` now accept data frames with categorical data.
Bug fixes:
- The :meth:`score` method of :class:`~glum.GeneralizedLinearRegressor` and :class:`~glum.GeneralizedLinearRegressorCV` now accepts offsets.
- Fixed the calculation of the information matrix for the Binomial distribution with logit link, which affected nonrobust standard errors.
Other:
- The CI now runs daily unit tests against the nightly builds of numpy, pandas and scikit-learn.
- The minimally required version of tabmat is now 3.1.0.
Other:
- We are now specifying the run time dependencies in
setup.py, so that missing dependencies are automatically installed from PyPI when installingglumvia pip.
Bug fix:
- Fixed the sign of the log likelihood of the Gaussian distribution (not used for fitting coefficients).
- Fixed the wide benchmarks which had duplicated columns (categorical and numerical).
Other:
- The CI now builds the wheels and upload to pypi with every new release.
- Renamed functions checking for qc.matrix compliance to refer to tabmat.
Bug fix:
- Fixed pyproject.toml. We now support installing through pip and pep517.
Breaking changes:
- Renamed the package to
glum!! Hurray! Celebration. - :class:`~glum.GeneralizedLinearRegressor` and :class:`~glum.GeneralizedLinearRegressorCV` lose the
fit_dispersionparameter. Please use the :meth:`dispersion` method of the appropriate family instance instead. - All functions now use
sample_weightas a keyword instead ofweights, in line with scikit-learn. - All functions now use
dispersionas a keyword instead ofphi. - Several methods :class:`~glum.GeneralizedLinearRegressor` and :class:`~glum.GeneralizedLinearRegressorCV` that should have been private have had an underscore prefixed on their names: :meth:`tear_down_from_fit`, :meth:`_set_up_for_fit`, :meth:`_set_up_and_check_fit_args`, :meth:`_get_start_coef`, :meth:`_solve` and :meth:`_solve_regularization_path`.
- :meth:`glum.GeneralizedLinearRegressor.report_diagnostics` and :meth:`glum.GeneralizedLinearRegressor.get_formatted_diagnostics` are now public.
New features:
- P1 and P2 now accepts 1d array with the same number of elements as the unexpanded design matrix. In this case, the penalty associated with a categorical feature will be expanded to as many elements as there are levels, all with the same value.
- :class:`ExponentialDispersionModel` gains a :meth:`dispersion` method.
- :class:`BinomialDistribution` and :class:`TweedieDistribution` gain a :meth:`log_likelihood` method.
- The :meth:`fit` method of :class:`~glum.GeneralizedLinearRegressor` and :class:`~glum.GeneralizedLinearRegressorCV` now saves the column types of pandas data frames.
- :class:`~glum.GeneralizedLinearRegressor` and :class:`~glum.GeneralizedLinearRegressorCV` gain two properties:
family_instanceandlink_instance. - :meth:`~glum.GeneralizedLinearRegressor.std_errors` and :meth:`~glum.GeneralizedLinearRegressor.covariance_matrix` have been added and support non-robust, robust (HC-1), and clustered covariance matrices.
- :class:`~glum.GeneralizedLinearRegressor` and :class:`~glum.GeneralizedLinearRegressorCV` now accept
family='gaussian'as an alternative tofamily='normal'.
Bug fix:
- The :meth:`score` method of :class:`~glum.GeneralizedLinearRegressor` and :class:`~glum.GeneralizedLinearRegressorCV` now accepts data frames.
- Upgraded the code to use tabmat 3.0.0.
Other:
- A major overhaul of the documentation. Everything is better!
- The methods of the link classes will now return scalars when given scalar inputs. Under certain circumstances, they'd return zero-dimensional arrays.
- There is a new benchmark available
glm_benchmarks_runbased on the Boston housing dataset. See here. glm_benchmarks_analyzenow includesoffsetin the index. See here.glmnet_pythonwas removed from the benchmarks suite.- The innermost coordinate descent was optimized. This speeds up coordinate descent dominated problems like LASSO by about 1.5-2x. See here.
Bug fix:
- Have the :meth:`linear_predictor` and :meth:`predict` methods of :class:`~glum.GeneralizedLinearRegressor` and :class:`~glum.GeneralizedLinearRegressorCV`
honor the offset when
alphaisNone.
New features:
- The :meth:`linear_predictor` and :meth:`predict` methods of :class:`~glum.GeneralizedLinearRegressor` and :class:`~glum.GeneralizedLinearRegressorCV`
gain an
alphaparameter (in complement toalpha_index). Moreover, they are now able to predict for multiple penalties.
Other:
- Methods of :class:`~glum._link.Link` now consistently return NumPy arrays, whereas they used to preserve pandas series in special cases.
- Don't list
sparse_dot_mklas a runtime requirement from the conda recipe. - The minimal
numpypin should be dependent on thenumpyversion inhostand not fixed to1.16.
Bug fix:
copy_X = Falsewill now raise a value error whenXhas dtypeint32orint64. Previously, it would only raise for dtypeint64.
Tutorials and documentation improvements:
- Adding tutorials to the documentation.
- Additional documentation improvements.
Bug fix:
- Verbose progress bar now working again.
Other:
- Small improvement in documentation for the
alpha_indexargument to :meth:`~glum.GeneralizedLinearRegressor.predict`. - Pinned pre-commit hooks versions.
We now have Windows builds!
Deprecations:
- Fusing the
alphaandalphasarguments for :class:`~glum.GeneralizedLinearRegressor`.alphanow also accepts array like inputs.alphasis now deprecated but can still be used for backward compatibility. Thealphasargument will be removed with the next major version.
Bug fix:
- We removed entry points to functions in
glum_benchmarksfrom the conda package.
Bug fix:
- :func:`glum._distribution.unit_variance_derivative` is evaluating a proper numexpr expression again (regression in 1.3.0).
New features:
- We added a new solver based on
scipy.optimize.minimize(method='trust-constr'). - We added support for linear inequality constraints of type
A_ineq.dot(coef_) <= b_ineq.
We removed glum_benchmarks from the conda package.
Maintenance release to get a fresh build for OSX.
New feature:
- Direct support for pandas categorical types in
fitandpredict. These will be converted into a :class:`CategoricalMatrix`.
This is a maintenance release to be compatible with tabmat>=1.0.0.
Other:
- Renamed
alpha_levelattribute of :class:`~glum.GeneralizedLinearRegressor` and :class:`~glum.GeneralizedLinearRegressorCV` toalpha_index. - Clarified behavior of
scale_predictors.
Other:
- Pin
tabmat<1.0.0as we are expecting a breaking change with version 1.0.0.
New features:
- Add Tweedie Link.
- Allow infinite bounds.
Bug fixes:
- Unstandardize regularization path.
- No copying in predict.
Other:
- Various memory and performance improvements.
- Update pre-commit hooks.
See git history.
See git history.
See git history.
See git history.
See git history.
See git history.
See git history.
See git history.
See git history.
See git history.
See git history.