Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] Add missing entries to whatsnew #15398

Merged
merged 8 commits into from Nov 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
83 changes: 78 additions & 5 deletions doc/whats_new/v0.22.rst
Expand Up @@ -14,17 +14,58 @@ refer to
:ref:`sphx_glr_auto_examples_release_highlights_plot_release_highlights_0_22_0.py`.


Clear definition of the public API
----------------------------------

Scikit-learn has a public API, and a private API.

We do our best not to break the public API, and to only introduce
backward-compatible changes that do not require any user action. However, in
cases where that's not possible, any change to the public API is subject to
a deprecation cycle of two minor versions. The private API isn't publicly
documented and isn't subject to any deprecation cycle, so users should not
rely on its stability.

A function or object is public if it is documented in the `API Reference
<https://scikit-learn.org/dev/modules/classes.html>`_ and if it can be
imported with an import path without leading underscores. For example
``sklearn.pipeline.make_pipeline`` is public, while
`sklearn.pipeline._name_estimators` is private.
``sklearn.ensemble._gb.BaseEnsemble`` is private too because the whole `_gb`
module is private.

Up to 0.22, some tools were de-facto public (no leading underscore), while
they should have been private in the first place. In version 0.22, these
tools have been made properly private, and the public API space has been
cleaned. In addition, importing from most sub-modules is now deprecated: you
should for example use ``from sklearn.cluster import Birch`` instead of
``from sklearn.cluster.birch import Birch`` (in practice, ``birch.py`` has
been moved to ``_birch.py``).

.. note::

All the tools in the public API should be documented in the `API
Reference <https://scikit-learn.org/dev/modules/classes.html>`_. If you
find a public tool (without leading underscore) that isn't in the API
reference, that means it should either be private or documented. Please
let us know by opening an issue!


Deprecations: using ``FutureWarning`` from now on
-------------------------------------------------

When deprecating a feature, previous versions of scikit-learn used to raise
a ``DeprecationWarning``. Since the ``DeprecationWarnings`` aren't shown by
default by Python, scikit-learn needed to resort to a custom warning filter
that would always show the warnings.

This filter is now removed, and starting from 0.22 scikit-learn will show
``FutureWarnings`` for deprecations. :pr:`15080` by `Nicolas Hug`_.
to always show the warnings. That filter would sometimes interfere
with users custom warning filters.

Starting from version 0.22, scikit-learn will show ``FutureWarnings`` for
deprecations, `as recommended by the Python documentation
<https://docs.python.org/3/library/exceptions.html#FutureWarning>`_.
``FutureWarnings`` are always shown by default by Python, so the custom
filter has been removed and scikit-learn no longer hinders with user
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logger.addHandler(logging.StreamHandler())
is still there, but should be addressed in #15386

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is about warnings. I haven't looked into the logger issue but feel free to edit to your liking!

filters. :pr:`15080` by `Nicolas Hug`_.

Changed models
--------------
Expand Down Expand Up @@ -111,6 +152,12 @@ Changelog
exposes an ``n_iter_`` indicating the maximum number of iterations performed
on each seed. :pr:`15120` by `Adrin Jalali`_.

- |Fix| :class:`cluster.AgglomerativeClustering` and
:class:`cluster.FeatureAgglomeration` now raise an error if
`affinity='cosine'` and `X` has samples that are all-zeros. :pr:`7943` by
:user:`mthorrell`.


:mod:`sklearn.compose`
......................

Expand All @@ -123,6 +170,12 @@ Changelog
pass `**fit_params` to the underlying regressor.
:pr:`14890` by :user:`Miguel Cabrera <mfcabrera>`.

- |Fix| The :class:`compose.ColumnTransformer` now requires the number of
features to be consistent between `fit` and `transform`. A `FutureWarning`
is raised now, and this will raise an error in 0.24. If the number of
features isn't consistent and negative indexing is used, an error is
raised. :pr:`14544` by `Adrin Jalali`_.

:mod:`sklearn.cross_decomposition`
..................................

Expand Down Expand Up @@ -369,6 +422,10 @@ Changelog
:class:`ensemble.HistGradientBoostingRegressor`. :pr:`13769` by
`Nicolas Hug`_.

- |Enhancement| :func:`inspection.plot_partial_dependence` has been extended to
now support the new visualization API described in the :ref:`User Guide
<visualizations>`. :pr:`14646` by `Thomas Fan`_.

- |Enhancement| :func:`inspection.partial_dependence` accepts pandas DataFrame
and :class:`pipeline.Pipeline` containing :class:`compose.ColumnTransformer`.
:pr:`14028` by :user:`Guillaume Lemaitre <glemaitre>`.
Expand Down Expand Up @@ -520,6 +577,10 @@ Changelog
``multioutput`` parameter.
:pr:`14732` by :user:`Agamemnon Krasoulis <agamemnonc>`.

- |Enhancement| 'roc_auc_ovr_weighted' and 'roc_auc_ovo_weighted' can now be
used as the :term:`scoring` parameter of model-selection tools.
:pr:`14417` by `Thomas Fan`_.

:mod:`sklearn.model_selection`
..............................

Expand All @@ -545,6 +606,11 @@ Changelog
`random_state` is set but `shuffle` is False. This will raise an error in
0.24.

- |Fix| The `cv_results_` attribute of :class:`model_selection.GridSearchCV`
and :class:`model_selection.RandomizedSearchCV` now only contains unfitted
estimators. This potentially saves a lot of memory since the state of the
estimators isn't stored. :pr:`#15096` by :user:`Andreas Müller <amueller>`.

:mod:`sklearn.multioutput`
..........................

Expand Down Expand Up @@ -617,6 +683,9 @@ Changelog
:mod:`sklearn.preprocessing`
............................

- |Efficiency| :class:`preprocessing.PolynomialFeatures` is now faster when
the input data is dense. :pr:`13290` by :user:`Xavier Dupré <sdpython>`.

- |Enhancement| Avoid unnecessary data copy when fitting preprocessors
:class:`preprocessing.StandardScaler`, :class:`preprocessing.MinMaxScaler`,
:class:`preprocessing.MaxAbsScaler`, :class:`preprocessing.RobustScaler`
Expand Down Expand Up @@ -776,7 +845,7 @@ Miscellaneous

- |Fix| Port `lobpcg` from SciPy which implement some bug fixes but only
available in 1.3+.
:pr:`13609` by :user:`Guillaume Lemaitre <glemaitre>`.
:pr:`13609` and :pr:`14971` by :user:`Guillaume Lemaitre <glemaitre>`.

Changes to estimator checks
---------------------------
Expand Down Expand Up @@ -812,3 +881,7 @@ These changes mostly affect library developers.
:pr:`13392` by :user:`Rok Mihevc <rok>`.

- |Fix| Added ``check_transformer_data_not_an_array`` to checks where missing

- |Fix| The estimators tags resolution now follows the regular MRO. They used
to be overridable only once. :pr:`14884` by :user:`Andreas Müller
<amueller>`.