3.5.0 - 2026-11-16
Bug fixes:
- Fixed
categorical_levels_for polarsCategoricalcolumns not matching the design matrix columns. This could cause wrong predictions or errors inpredict. - Fixed
monotonic_constraintsraisingValueErrorwhen a formula term contains square brackets, e.g.bs(x, knots=[15, 20, 30]). - Fixed
monotonic_constraintsnot giving a monotone fitted effect when the first spline basis or categorical level is dropped, e.g. forbs()withoutinclude_intercept=TrueorC()withdrop_first=True. Detecting the droppedbs()basis requires tabmat 4.3.0, which recordsspans_intercept, so the minimum tabmat version is now 4.3.0. - Fixed a pandas deprecation warning being emitted before the "unseen categories"
ValueErrorwhen predicting on data with unseen categories. - Fixed the solver for
monotonic_constraintscomparing objective values computed with different constraint penalties in its line search. This caused spurious "Line search failed" convergence warnings and extra iterations. - The "Line search failed"
ConvergenceWarningis no longer emitted when the loss no longer changes up to machine precision, since users cannot act on it. - Replaced the "Sigmoid function too close to 0 or 1. Clipping." warning of the logit and cloglog links by a warning after the final fit. The old warning was emitted for single observations and intermediate solver iterations, which users cannot act on. The new warning is only emitted if more than 1% of the fitted values are numerically 0 or 1, which typically indicates (quasi-)perfect separation (for the cloglog link, only fitted values of 0 count, because values of 1 are routine). It suggests more regularization or removing the separating features.
- Fixed tabmat's "Input array is not contiguous; making a copy." warning being emitted for row slices of pandas data frames, e.g.
df.iloc[:n], infit,predictandscore. tabmat itself no longer emits this warning after 4.3.1. - Fixed
monotonic_constraintsordering the levels of an ordered categorical by their label (e.g. alphabetically) instead of by the category order. monotonic_constraintsnow raises aValueErrorfor unordered categoricals, and forcr()andcs()splines, instead of silently failing to enforce monotonicity.
Other changes:
- Removed scikit-learn from build dependencies.
- Warnings are now treated as errors in the test suite and in the README doctest in CI, except in the
nightlyandoldiesenvironments. - The documentation build now treats warnings as errors and runs in CI. Fixed the docstring formatting of
cat_missing_methodandget_linkand several broken links in the tutorials and the changelog. - Require Python>=3.11, since conda-forge no longer supports Python 3.10. No Python 3.10 wheels are built or uploaded to PyPI any more.
- Added
py314andpy315test environments, and a conda package build for Python 3.15. - Removed the
py310test environment and moved theoldiesenvironment and the conda package builds from Python 3.10 to 3.11, since conda-forge no longer supports Python 3.10. Theoldiespins for pandas (1.5), scikit-learn (1.1.3) and scipy (1.9) were raised to the oldest releases with Python 3.11 builds.
Full Changelog: v3.4.1...v3.5.0