Version 1.9#

Legend for changelogs

  • Major Feature something big that you couldn’t do before.

  • Feature something that you couldn’t do before.

  • Efficiency an existing feature now may not require as much computation or memory.

  • Enhancement a miscellaneous minor improvement.

  • Fix something that previously didn’t work as documented – or according to reasonable expectations – should now work.

  • API Change you will need to change your code to have the same effect in the future; or a feature will be removed in the future.

Version 1.9.dev0#

March 2026

Changed models#

  • Enhancement The transform method of preprocessing.PowerTransformer with method="yeo-johnson" now uses the numerical more stable function scipy.stats.yeojohnson instead of an own implementation. The results may deviate in numerical edge cases or within the precision of floating-point arithmetic. By Christian Lorentzen. #33272

Changes impacting many modules#

  • Enhancement pipeline.Pipeline, pipeline.FeatureUnion and compose.ColumnTransformer now raise a clearer error message when an estimator class is passed instead of an instance. By Anne Beyer #32888

  • Fix Raise ValueError when sample_weight contains only zero values to prevent meaningless input data during fitting. This change applies to all estimators that support the parameter sample_weight. This change also affects metrics that validate sample weights. By Lucy Liu and John Hendricks. #32212

  • Fix Some parameter descriptions in the HTML representation of estimators were not properly escaped, which could lead to malformed HTML if the description contains characters like < or >. By Olivier Grisel. #32942

Support for Array API#

Additional estimators and functions have been updated to include support for all Array API compliant inputs.

See Array API support (experimental) for more details.

Metadata routing#

Refer to the Metadata Routing User Guide for more details.

sklearn.cluster#

sklearn.compose#

sklearn.datasets#

sklearn.ensemble#

  • Fix Fixed the way ensemble.HistGradientBoostingClassifier and ensemble.HistGradientBoostingRegressor compute their bin edges to properly and consistently handle sample_weight. When sample_weights=None is passed to fit and the number of distinct feature values is less than the specified max_bins, the edges are still set to midpoints between consecutive feature values. Otherwise, the bin edges are set to weight-aware quantiles computed using the averaged inverted CDF method. If n_samples is larger than the subsample parameter, the weights are instead used to subsample the data (with replacement) and the bin edges are set using unweighted quantiles of the subsampled data. By Shruti Nath and Olivier Grisel #29641

  • Fix ensemble.RandomForestClassifier, ensemble.RandomForestRegressor, ensemble.ExtraTreesClassifier and ensemble.ExtraTreesRegressor now use sample_weight to draw the samples instead of forwarding them multiplied by a uniformly sampled mask to the underlying estimators. Furthermore, when max_samples is a float, it is now interpreted as a fraction of sample_weight.sum() instead of X.shape[0]. As sampling is done with replacement, a float max_samples greater than 1.0 is now allowed, as well as an integer max_samples greater then X.shape[0]. The default max_samples=None draws X.shape[0] samples, irrespective of sample_weight. By Antoine Baker. #31529

  • Fix Both ensemble.GradientBoostingRegressor and ensemble.GradientBoostingClassifier with the default "friedman_mse" criterion were computing impurity values with an incorrect scaling, leading to unexpected trees in some cases. The implementation now uses "squared_error", which is exactly equivalent to "friedman_mse" up to floating-point error discrepancies but computes correct impurity values. By Arthur Lacote. #32708

  • API Change The criterion parameter is now deprecated for classes ensemble.GradientBoostingRegressor and ensemble.GradientBoostingClassifier, as both options ("friedman_mse" and "squared_error") were producing the same results, up to floating-point rounding discrepancies and a bug in "friedman_mse". By Arthur Lacote #32708

sklearn.inspection#

sklearn.linear_model#

sklearn.manifold#

  • Fix manifold.MDS.transform returns the correct number of components when using init="classical_mds". By Ben Pedigo. #33318

sklearn.metrics#

sklearn.pipeline#

sklearn.svm#

sklearn.tree#

sklearn.utils#

Code and documentation contributors

Thanks to everyone who has contributed to the maintenance and improvement of the project since version 1.8, including:

TODO: update at the time of the release.