Version 0.6.1
Bug fixes for scikit-learn integration, distribution attribute handling, and prediction indexing. Several distribution attributes are deprecated with FutureWarning to fix naming inconsistencies before a future breaking release.
Bug fixes
- Fix
cloneandGridSearchCVforNGBSurvival.NGBSurvival, andNGBRegressorwith a distribution that has only censored scores such asLogNormal, now storeDistas passed.set_params(Dist=...)andset_params(Score=...)now take effect at the nextfitfor every model, andNGBSurvival.score(X, T, E)takes the event indicators, whichGridSearchCVpasses to it when metadata routing is on (issue #270, PR #432) - Stop the overflow warnings from trial steps that the line search rejects, such as
overflow encountered in expinNormal. They came most often fromnatural_gradient=Falseon a target with large units. Fitted models do not change (issue #352, PR #434) fitnow raises aValueErrorthat says the fit diverged when the gradient has non-finite values, in place of the base learner'sInput y contains NaNerror (PR #434)- Raise
AttributeErrorfor an attribute that a distribution does not have. Before, the distributions built onscipy.statsreturnedNone, so a typo such asdist.sfailed silently. Predicted distributions can now be pickled and deep-copied (issue #168, PR #433) - Fix
len(dist)and slicing such asdist[0:2]forNormalFixedVarandNormalFixedMeanpredictions, which raised an error because these classes did not store their parameters. New tests checklenand slicing for every distribution inngboost.distns(PR #441) - Fix integer indexing such as
dist[0]forBernoulli,k_categoricalandMultivariateNormalpredictions, which raised an error because their constructors needed two-dimensional params.dist[i]is now the distribution of row i without the row axis, as for the other distributions (PR #442) - Allow scikit-learn 1.7 and later on Python < 3.14. Before, ngboost needed scikit-learn < 1.7 there, so it could not be installed together with packages such as SHAP that need a newer version (issue #463, PR #464)
New features
MultivariateNormalparamsnow gives the covariance matrices under the keycov, the name thatscipy.stats.multivariate_normaluses. The old keyscaleis deprecated:params['scale']andparams.get('scale')still return the covariance, but give aFutureWarning. Everywhere else in ngboostscaleis a standard deviation, so users read the covariance as one.scaleis no longer inparams.keys()(issue #168, PR #438)- Add
muandsigmatoLogNormal, the mean and standard deviation of log(Y).LogNormal.locandLogNormal.scaleare deprecated and give aFutureWarning.LogNormal.scalewas sigma, butparams['scale']is exp(mu) as inscipy.stats.lognorm, and users mixed the two up.paramsdoes not change (issue #168, PR #433) - The
varattribute ofNormal,NormalFixedVar,NormalFixedMean,T,TFixedDf,TFixedDfFixedVar,CauchyandCauchyFixedVaris deprecated and gives aFutureWarning. It hides thevar()method ofscipy.stats, sodist.var()raisesTypeErroron these classes, while it works on the other distributions. In a future release,varwill be that method. Usedist.scale ** 2for the current values, which works on every version. For the Normal classes these values are the variance. For the T and Cauchy classes they are the squared scale, not the variance (issue #168, PR #439) - Add
dfto theparamsofT,TFixedDfandTFixedDfFixedVar, so thatscipy.stats.t(**dist.params)rebuilds the predicted distribution. Before,paramsheld onlylocandscale. TheparamsofCauchyandCauchyFixedVarstill hold onlylocandscale, so thatscipy.stats.cauchy(**dist.params)works as before (issue #168, PR #440)
Documentation and CI
- Add a section on overflow warnings and diverging fits to the tuning page of the user guide (PR #434)
- Add SHAP integration tests for
NGBRegressorandNGBClassifierwith theExplainerandTreeExplainerAPIs (PR #464) - Fix the
xfailmarker ontest_dists_runs_on_examples_logscoreto target only theTdistribution case, not all distributions (PR #437) - Add
CONTRIBUTING.md, which tells contributors how to write a release note and what counts as a breaking change, and a PR template. The release notes now have anUnreleasedsection that each PR adds to (PR #468)