Up to [cvs.NetBSD.org] / pkgsrc / math / py-scikit-learn / patches
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
py-scikit-learn: updated to 1.8.0 Version 1.8.0 Changes impacting many modules - |Efficiency| Improved CPU and memory usage in estimators and metric functions that rely on weighted percentiles and better match NumPy and Scipy (un-weighted) implementations of percentiles. Support for Array API Additional estimators and functions have been updated to include support for all `Array API <https://data-apis.org/array-api/latest/>`_ compliant inputs.
py-scikit-learn: updated to 1.5.1
Version 1.5.1
=============
**July 2024**
Changes impacting many modules
------------------------------
- |Fix| Fixed a regression in the validation of the input data of all estimators where
an unexpected error was raised when passing a DataFrame backed by a read-only buffer.
:pr:`29018` by :user:`Jérémie du Boisberranger <jeremiedbb>`.
- |Fix| Fixed a regression causing a dead-lock at import time in some settings.
:pr:`29235` by :user:`Jérémie du Boisberranger <jeremiedbb>`.
Changelog
---------
:mod:`sklearn.compose`
......................
- |Efficiency| Fix a performance regression in :class:`compose.ColumnTransformer`
where the full input data was copied for each transformer when `n_jobs > 1`.
:pr:`29330` by :user:`Jérémie du Boisberranger <jeremiedbb>`.
:mod:`sklearn.metrics`
......................
- |Fix| Fix a regression in :func:`metrics.r2_score`. Passing torch CPU tensors
with array API dispatched disabled would complain about non-CPU devices
instead of implicitly converting those inputs as regular NumPy arrays.
:pr:`29119` by :user:`Olivier Grisel`.
- |Fix| Fix a regression in :func:`metrics.accuracy_score` and in
:func:`metrics.zero_one_loss` causing an error for Array API dispatch with multilabel
inputs.
:pr:`29269` by :user:`Yaroslav Korobko <Tialo>` and
:pr:`29336` by :user:`Edoardo Abati <EdAbati>`.
:mod:`sklearn.model_selection`
..............................
- |Fix| Fix a regression in :class:`model_selection.GridSearchCV` for parameter
grids that have heterogeneous parameter values.
:pr:`29078` by :user:`Loïc Estève <lesteve>`.
- |Fix| Fix a regression in :class:`model_selection.GridSearchCV` for parameter
grids that have estimators as parameter values.
:pr:`29179` by :user:`Marco Gorelli<MarcoGorelli>`.
- |Fix| Fix a regression in :class:`model_selection.GridSearchCV` for parameter
grids that have arrays of different sizes as parameter values.
:pr:`29314` by :user:`Marco Gorelli<MarcoGorelli>`.
:mod:`sklearn.tree`
...................
- |Fix| Fix an issue in :func:`tree.export_graphviz` and :func:`tree.plot_tree`
that could potentially result in exception or wrong results on 32bit OSes.
:pr:`29327` by :user:`Loïc Estève<lesteve>`.
:mod:`sklearn.utils`
....................
- |API| :func:`utils.validation.check_array` has a new parameter, `force_writeable`, to
control the writeability of the output array. If set to `True`, the output array will
be guaranteed to be writeable and a copy will be made if the input array is read-only.
If set to `False`, no guarantee is made about the writeability of the output array.
:pr:`29018` by :user:`Jérémie du Boisberranger <jeremiedbb>`.
.. _changes_1_5:
Version 1.5.0
=============
**May 2024**
Security
--------
- |Fix| :class:`feature_extraction.text.CountVectorizer` and
:class:`feature_extraction.text.TfidfVectorizer` no longer store discarded
tokens from the training set in their `stop_words_` attribute. This attribute
would hold too frequent (above `max_df`) but also too rare tokens (below
`min_df`). This fixes a potential security issue (data leak) if the discarded
rare tokens hold sensitive information from the training set without the
model developer's knowledge.
Note: users of those classes are encouraged to either retrain their pipelines
with the new scikit-learn version or to manually clear the `stop_words_`
attribute from previously trained instances of those transformers. This
attribute was designed only for model inspection purposes and has no impact
on the behavior of the transformers.
:pr:`28823` by :user:`Olivier Grisel <ogrisel>`.
Changed models
--------------
- |Efficiency| The subsampling in :class:`preprocessing.QuantileTransformer` is now
more efficient for dense arrays but the fitted quantiles and the results of
`transform` may be slightly different than before (keeping the same statistical
properties).
:pr:`27344` by :user:`Xuefeng Xu <xuefeng-xu>`.
- |Enhancement| :class:`decomposition.PCA`, :class:`decomposition.SparsePCA`
and :class:`decomposition.TruncatedSVD` now set the sign of the `components_`
attribute based on the component values instead of using the transformed data
as reference. This change is needed to be able to offer consistent component
signs across all `PCA` solvers, including the new
`svd_solver="covariance_eigh"` option introduced in this release.
Changes impacting many modules
------------------------------
- |Fix| Raise `ValueError` with an informative error message when passing 1D
sparse arrays to methods that expect 2D sparse inputs.
:pr:`28988` by :user:`Olivier Grisel <ogrisel>`.
- |API| The name of the input of the `inverse_transform` method of estimators has been
standardized to `X`. As a consequence, `Xt` is deprecated and will be removed in
version 1.7 in the following estimators: :class:`cluster.FeatureAgglomeration`,
:class:`decomposition.MiniBatchNMF`, :class:`decomposition.NMF`,
:class:`model_selection.GridSearchCV`, :class:`model_selection.RandomizedSearchCV`,
:class:`pipeline.Pipeline` and :class:`preprocessing.KBinsDiscretizer`.
:pr:`28756` by :user:`Will Dean <wd60622>`.
Support for Array API
---------------------
Additional estimators and functions have been updated to include support for all
`Array API <https://data-apis.org/array-api/latest/>`_ 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 <elindgren>`, :user:`Franck Charras <fcharras>`,
:user:`Olivier Grisel <ogrisel>` and :user:`Tim Head <betatim>`.
**Classes:**
- :class:`linear_model.Ridge` now supports the Array API for the `svd` solver.
See :ref:`array_api` for more details.
:pr:`27800` by :user:`Franck Charras <fcharras>`, :user:`Olivier Grisel <ogrisel>`
and :user:`Tim Head <betatim>`.
Support for building with Meson
-------------------------------
From scikit-learn 1.5 onwards, Meson is the main supported way to build
scikit-learn, see :ref:`Building from source <install_bleeding_edge>` for more
details.
Unless we discover a major blocker, setuptools support will be dropped in
scikit-learn 1.6. The 1.5.x releases will support building scikit-learn with
setuptools.
Meson support for building scikit-learn was added in :pr:`28040` by
:user:`Loïc Estève <lesteve>`
Metadata Routing
----------------
The following models now support metadata routing in one or more or their
methods. Refer to the :ref:`Metadata Routing User Guide <metadata_routing>` for
more details.
- |Feature| :class:`impute.IterativeImputer` now supports metadata routing in
its `fit` method. :pr:`28187` by :user:`Stefanie Senger <StefanieSenger>`.
- |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 <adam2392>` and
:user:`Benjamin Bossan <BenjaminBossan>`.
- |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 <OmarManzoor>`.
- |Feature| :class:`GraphicalLassoCV` now supports metadata routing in it's
`fit` method and routes metadata to the CV splitter.
:pr:`27566` by :user:`Omar Salman <OmarManzoor>`.
- |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 <StefanieSenger>`.
- |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 <StefanieSenger>`.
- |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 <StefanieSenger>`.
- |Fix| Fix an issue when resolving default routing requests set via class
attributes.
:pr:`28435` by `Adrin Jalali`_.
- |Fix| Fix an issue when `set_{method}_request` methods are used as unbound
methods, which can happen if one tries to decorate them.
:pr:`28651` by `Adrin Jalali`_.
- |FIX| Prevent a `RecursionError` when estimators with the default `scoring`
param (`None`) route metadata.
:pr:`28712` by :user:`Stefanie Senger <StefanieSenger>`.
py-scikit-learn: fix build on NetBSD