.. include:: _contributors.rst .. currentmodule:: sklearn .. _release_notes_1_5: =========== Version 1.5 =========== .. -- UNCOMMENT WHEN 1.5.0 IS RELEASED -- For a short description of the main highlights of the release, please refer to :ref:`sphx_glr_auto_examples_release_highlights_plot_release_highlights_1_5_0.py`. .. include:: changelog_legend.inc .. _changes_1_5: Version 1.5.0 ============= **In Development** Support for Array API --------------------- Additional estimators and functions have been updated to include support for all `Array API `_ compliant inputs. See :ref:`array_api` for more details. **Functions:** - :func:`sklearn.metrics.r2_score` now supports Array API compliant inputs. :pr:`27904` by :user:`Eric Lindgren `, `Franck Charras `, `Olivier Grisel ` and `Tim Head `. **Classes:** Support for building with Meson ------------------------------- Meson is now supported as a build backend, see :ref:`Building with Meson ` for more details. :pr:`28040` by :user:`Loïc Estève ` TODO Fill more details before the 1.5 release, when the Meson story has settled down. Metadata Routing ---------------- The following models now support metadata routing in one or more or their methods. Refer to the :ref:`Metadata Routing User Guide ` for more details. - |Feature| :class:`impute.IterativeImputer` now supports metadata routing in its `fit` method. :pr:`28187` by :user:`Stefanie Senger `. - |Feature| :class:`ensemble.BaggingClassifier` and :class:`ensemble.BaggingRegressor` now support metadata routing. The fit methods now accept ``**fit_params`` which are passed to the underlying estimators via their `fit` methods. :pr:`28432` by :user:`Adam Li ` and :user:`Benjamin Bossan `. - |Feature| :class:`linear_model.RidgeCV` and :class:`linear_model.RidgeClassifierCV` now support metadata routing in their `fit` method and route metadata to the underlying :class:`model_selection.GridSearchCV` object or the underlying scorer. :pr:`27560` by :user:`Omar Salman `. Metadata Routing ---------------- The following models now support metadata routing in one or more or their methods. Refer to the :ref:`Metadata Routing User Guide ` for more details. - |Feature| :class:`linear_model.RANSACRegressor` now supports metadata routing in its ``fit``, ``score`` and ``predict`` methods and route metadata to its underlying estimator's' ``fit``, ``score`` and ``predict`` methods. :pr:`28261` by :user:`Stefanie Senger `. - |Feature| :class:`ensemble.VotingClassifier` and :class:`ensemble.VotingRegressor` now support metadata routing and pass ``**fit_params`` to the underlying estimators via their `fit` methods. :pr:`27584` by :user:`Stefanie Senger `. - |Feature| :class:`pipeline.FeatureUnion` now supports metadata routing in its ``fit`` and ``fit_transform`` methods and route metadata to the underlying transformers' ``fit`` and ``fit_transform``. :pr:`28205` by :user:`Stefanie Senger `. Changelog --------- .. Entries should be grouped by module (in alphabetic order) and prefixed with one of the labels: |MajorFeature|, |Feature|, |Efficiency|, |Enhancement|, |Fix| or |API| (see whats_new.rst for descriptions). Entries should be ordered by those labels (e.g. |Fix| after |Efficiency|). Changes not specific to a module should be listed under *Multiple Modules* or *Miscellaneous*. Entries should end with: :pr:`123456` by :user:`Joe Bloggs `. where 123455 is the *pull request* number, not the issue number. :mod:`sklearn.cluster` ...................... - |FIX| Create copy of precomputed sparse matrix within the `fit` method of :class:`~cluster.OPTICS` to avoid in-place modification of the sparse matrix. :pr:`28491` by :user:`Thanh Lam Dang `. :mod:`sklearn.compose` ...................... - |Feature| A fitted :class:`compose.ColumnTransformer` now implements `__getitem__` which returns the fitted transformers by name. :pr:`27990` by `Thomas Fan`_. - |Enhancement| :class:`compose.TransformedTargetRegressor` now raises an error in `fit` if only `inverse_func` is provided without `func` (that would default to identity) being explicitly set as well. :pr:`28483` by :user:`Stefanie Senger `. :mod:`sklearn.datasets` ....................... - |Enhancement| Adds optional arguments `n_retries` and `delay` to functions :func:`datasets.fetch_20newsgroups`, :func:`datasets.fetch_20newsgroups_vectorized`, :func:`datasets.fetch_california_housing`, :func:`datasets.fetch_covtype`, :func:`datasets.fetch_kddcup99`, :func:`datasets.fetch_lfw_pairs`, :func:`datasets.fetch_lfw_people`, :func:`datasets.fetch_olivetti_faces`, :func:`datasets.fetch_rcv1`, and :func:`datasets.fetch_species_distributions`. By default, the functions will retry up to 3 times in case of network failures. :pr:`28160` by :user:`Zhehao Liu ` and :user:`Filip Karlo Došilović `. :mod:`sklearn.decomposition` ............................ - |Enhancement| :class:`~decomposition.PCA` now automatically selects the ARPACK solver for sparse inputs when `svd_solver="auto"` instead of raising an error. :pr:`28498` by :user:`Thanh Lam Dang `. :mod:`sklearn.dummy` .................... - |Enhancement| :class:`dummy.DummyClassifier` and :class:`dummy.DummyRegressor` now have the `n_features_in_` and `feature_names_in_` attributes after `fit`. :pr:`27937` by :user:`Marco vd Boom `. :mod:`sklearn.ensemble` ....................... - |Efficiency| Improves runtime of `predict` of :class:`ensemble.HistGradientBoostingClassifier` by avoiding to call `predict_proba`. :pr:`27844` by :user:`Christian Lorentzen `. - |Efficiency| :class:`ensemble.HistGradientBoostingClassifier` and :class:`ensemble.HistGradientBoostingRegressor` are now a tiny bit faster by pre-sorting the data before finding the thresholds for binning. :pr:`28102` by :user:`Christian Lorentzen `. :mod:`sklearn.feature_extraction` ................................. - |Efficiency| :class:`feature_extraction.text.TfidfTransformer` is now faster and more memory-efficient by using a NumPy vector instead of a sparse matrix for storing the inverse document frequency. :pr:`18843` by :user:`Paolo Montesel `. - |Enhancement| :class:`feature_extraction.text.TfidfTransformer` now preserves the data type of the input matrix if it is `np.float64` or `np.float32`. :pr:`28136` by :user:`Guillaume Lemaitre `. :mod:`sklearn.feature_selection` ................................ - |Enhancement| :func:`feature_selection.mutual_info_regression` and :func:`feature_selection.mutual_info_classif` now support `n_jobs` parameter. :pr:`28085` by :user:`Neto Menoci ` and :user:`Florin Andrei `. :mod:`sklearn.impute` ..................... - |Enhancement| :class:`impute.SimpleImputer` now supports custom strategies by passing a function in place of a strategy name. :pr:`28053` by :user:`Mark Elliot `. :mod:`sklearn.linear_model` ........................... - |Fix| :class:`linear_model.ElasticNet`, :class:`linear_model.ElasticNetCV`, :class:`linear_model.Lasso` and :class:`linear_model.LassoCV` now explicitly don't accept large sparse data formats. :pr:`27576` by :user:`Stefanie Senger `. - |API| :class:`linear_model.RidgeCV` and :class:`linear_model.RidgeClassifierCV` will now allow `alpha=0` when `cv != None`, which is consistent with :class:`linear_model.Ridge` and :class:`linear_model.RidgeClassifier`. :pr:`28425` by :user:`Lucy Liu `. - |Fix| :class:`linear_model.RidgeCV` and :class:`RidgeClassifierCV` correctly pass `sample_weight` to the underlying scorer when `cv` is None. :pr:`27560` by :user:`Omar Salman `. - |Fix| `n_nonzero_coefs_` attribute in :class:`linear_model.OrthogonalMatchingPursuit` will now always be `None` when `tol` is set, as `n_nonzero_coefs` is ignored in this case. :pr:`28557` by :user:`Lucy Liu `. - |API| Passing `average=0` to disable averaging is deprecated in :class:`linear_model.PassiveAggressiveClassifier`, :class:`linear_model.PassiveAggressiveRegressor`, :class:`linear_model.SGDClassifier`, :class:`linear_model.SGDRegressor` and :class:`linear_model.SGDOneClassSVM`. Pass `average=False` instead. :pr:`28582` by :user:`Jérémie du Boisberranger `. :mod:`sklearn.manifold` ....................... - |API| Deprecates `n_iter` in favor of `max_iter` in :class:`manifold.TSNE`. `n_iter` will be removed in version 1.7. This makes :class:`manifold.TSNE` consistent with the rest of the estimators. :pr:`28471` by :user:`Lucy Liu ` :mod:`sklearn.metrics` ...................... - |Feature| :func:`metrics.pairwise_distances` accepts calculating pairwise distances for non-numeric arrays as well. This is supported through custom metrics only. :pr:`27456` by :user:`Venkatachalam N `, :user:`Kshitij Mathur ` and :user:`Julian Libiseller-Egger `. - |Efficiency| Improve efficiency of functions :func:`~metrics.brier_score_loss`, :func:`~metrics.calibration_curve`, :func:`~metrics.det_curve`, :func:`~metrics.precision_recall_curve`, :func:`~metrics.roc_curve` when `pos_label` argument is specified. Also improve efficiency of methods `from_estimator` and `from_predictions` in :class:`~metrics.RocCurveDisplay`, :class:`~metrics.PrecisionRecallDisplay`, :class:`~metrics.DetCurveDisplay`, :class:`~calibration.CalibrationDisplay`. :pr:`28051` by :user:`Pierre de Fréminville `. - |Feature| :func:`sklearn.metrics.check_scoring` now returns a multi-metric scorer when `scoring` as a `dict`, `set`, `tuple`, or `list`. :pr:`28360` by `Thomas Fan`_. - |API| :func:`metrics.precision_recall_curve` deprecated the keyword argument `probas_pred` in favor of `y_score`. `probas_pred` will be removed in version 1.7. :pr:`28092` by :user:`Adam Li `. - |API| :func:`metrics.brier_score_loss` deprecated the keyword argument `y_prob` in favor of `y_proba`. `y_prob` will be removed in version 1.7. :pr:`28092` by :user:`Adam Li `. :mod:`sklearn.model_selection` .............................. - |Enhancement| :term:`CV splitters ` that ignores the group parameter now raises a warning when groups are passed in to :term:`split`. :pr:`28210` by - |Fix| the ``cv_results_`` attribute (of :class:`model_selection.GridSearchCV`) now returns masked arrays of the appropriate NumPy dtype, as opposed to always returning dtype ``object``. :pr:`28352` by :user:`Marco Gorelli`. - |Fix| :func:`sklearn.model_selection.train_test_score` works with Array API inputs. Previously indexing was not handled correctly leading to exceptions when using strict implementations of the Array API like CuPY. :pr:`28407` by `Tim Head `. :mod:`sklearn.multioutput` .......................... - |Enhancement| `chain_method` parameter added to `:class:``multioutput.ClassifierChain`. :pr:`27700` by :user:`Lucy Liu `. :mod:`sklearn.pipeline` ....................... - |Feature| :class:`pipeline.FeatureUnion` can now use the `verbose_feature_names_out` attribute. If `True`, `get_feature_names_out` will prefix all feature names with the name of the transformer that generated that feature. If `False`, `get_feature_names_out` will not prefix any feature names and will error if feature names are not unique. :pr:`25991` by :user:`Jiawei Zhang `. :mod:`sklearn.preprocessing` ............................ - |Enhancement| :class:`preprocessing.QuantileTransformer` and :func:`preprocessing.quantile_transform` now supports disabling subsampling explicitly. :pr:`27636` by :user:`Ralph Urlus `. :mod:`sklearn.tree` ................... - |Enhancement| Plotting trees in matplotlib via :func:`tree.plot_tree` now show a "True/False" label to indicate the directionality the samples traverse given the split condition. :pr:`28552` by :user:`Adam Li `. .. rubric:: Code and documentation contributors Thanks to everyone who has contributed to the maintenance and improvement of the project since version 1.4, including: TODO: update at the time of the release.