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 documentated – 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.
The following estimators and functions, when fit with the same data and parameters, may produce different models from the previous version. This often occurs due to changes in the modelling logic (bug fixes or enhancements), or in random sampling procedures.
Changes impacting all modules¶
The following models now support metadata routing in one or more or their methods. Refer to the Metadata Routing User Guide for more details.
cross_val_predictnow support metadata routing. The metadata are routed to the estimator’s
fit, the scorer, and the CV splitter’s
split. The metadata is accepted via the new
fit_paramsis deprecated and will be removed in version 1.6.
groupsparameter is also not accepted as a separate argument when metadata routing is enabled and should be passed via the
paramsparameter. #26896 by Adrin Jalali.
HalvingRandomSearchCVnow support metadata routing in their
score, and route metadata to the underlying estimator’s
fit, the CV splitter, and the scorer. #27058 by Adrin Jalali.
linear_model.LogisticRegressionCVnow supports metadata routing.
**paramswhich are passed to the underlying splitter and scorer.
**score_paramswhich are passed to the underlying scorer. #26525 by Omar Salman.
Support for SciPy sparse arrays¶
Several estimators are now supporting SciPy sparse arrays. The following functions and classes are impacted:
base.OutlierMixin.fit_predictnow raise a warning if
predictconsume metadata, but no custom
fit_predictis defined in the class inheriting from them correspondingly. #26831 by Adrin Jalali.
Enhancement An “auto” option was added to the
decomposition.MiniBatchNMFto automatically infer the number of components from W or H shapes when using a custom initialization. The default value of this parameter will change from
autoin version 1.6. #26634 by Alexandre Landeau and Alexandre Vigny.
decomposition.PCAnow supports the Array API for the
randomizedsolvers (with QR power iterations). See Array API support (experimental) for more details. #26315 and #27098 by Mateusz Sokół, Olivier Grisel and Edoardo Abati.
ensemble.RandomForestRegressorsupport missing values when the criterion is
log_loss, for classification or
poissonfor regression. #26391 by Thomas Fan.
ensemble.ExtraTreesRegressornow support monotonic constraints, useful when features are supposed to have a positive/negative effect on the target. Missing values in the train data and multi-output targets are not supported. #13649 by Samuel Ronsin, initiated by Patrick O’Reilly.
Efficiency Computing distances via
metrics.DistanceMetricfor CSR × CSR, Dense × CSR, and CSR × Dense now uses ~50% less memory, and outputs distances in the same dtype as the provided data. #27006 by Meekail Zain
Enhancement Improve the rendering of the plot obtained with the
metrics.RocCurveDisplayclasses. the x- and y-axis limits are set to [0, 1] and the aspect ratio between both axis is set to be 1 to get a square plot. #26366 by Mojdeh Rastgoo.
API Change The
metrics.mean_squared_log_erroris deprecated and will be removed in 1.6. Use the new functions
root_mean_squared_log_errorinstead. #26734 by Alejandro Martin Gil.
model_selection.HalvingGridSearchCVnow don’t change the given object in the parameter grid if it’s an estimator. #26786 by Adrin Jalali.
sklearn.neighbors.KNeighborsRegressor.predict_probanow efficiently support pairs of dense and sparse datasets. #27018 by Julien Jerphanion.
metric.DistanceMetricobjects directly via the
metrickeyword argument allowing for the use of accelerated third-party
metric.DistanceMetricobjects. #26267 by Meekail Zain
preprocessing.MaxAbsScalernow support the Array API. Array API support is considered experimental and might evolve without being subject to our usual rolling deprecation cycle policy. See Array API support (experimental) for more details. #26243 by Tim Head and #27110 by Edoardo Abati.
tree.ExtraTreeRegressornow support monotonic constraints, useful when features are supposed to have a positive/negative effect on the target. Missing values in the train data and multi-output targets are not supported. #13649 by Samuel Ronsin, initiated by Patrick O’Reilly.
sklearn.utils.estimator_html_reprdynamically adapts diagram colors based on the browser’s
prefers-color-scheme, providing improved adaptability to dark mode environments. #26862 by Andrew Goh Yisheng, Thomas Fan, Adrin Jalali.
sklearn.utils.check_arrayshould accept both matrix and array from the sparse SciPy module. The previous implementation would fail if
copy=Trueby calling specific NumPy
np.may_share_memorythat does not work with SciPy sparse array and does not return the correct result for SciPy sparse matrix. #27336 by Guillaume Lemaitre.
Code and Documentation Contributors¶
Thanks to everyone who has contributed to the maintenance and improvement of the project since version 1.3, including:
TODO: update at the time of the release.