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 3 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
62 changes: 48 additions & 14 deletions doc/whats_new/v0.22.rst
Expand Up @@ -14,17 +14,53 @@ refer to
:ref:`sphx_glr_auto_examples_release_highlights_plot_release_highlights_0_22_0.py`.


Cleaning of the public API
NicolasHug marked this conversation as resolved.
Show resolved Hide resolved
--------------------------

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

Any change to the public API is subject to a deprecation cycle of two minor
NicolasHug marked this conversation as resolved.
Show resolved Hide resolved
versions. The private API isn't publicly documented and isn't subject to any
deprecation cycle, so users should not rely on it.
NicolasHug marked this conversation as resolved.
Show resolved Hide resolved

Whether a tool is private or public depends on whether you can import it
without a leading underscore in the import path. For example
NicolasHug marked this conversation as resolved.
Show resolved Hide resolved
``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.
Copy link
Member

Choose a reason for hiding this comment

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

It'd be nice to also mention the classes/functions which are private because their name has a leading underscore, eventhough the path may be public.

Copy link
Member Author

Choose a reason for hiding this comment

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

There is sklearn.pipeline._name_estimators, were you thinking of something else?

Copy link
Member

Choose a reason for hiding this comment

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

some _BaseBlahBlah I guess. I think most of them are gonna be in the _filename locations and don't matter anyway. But not for the ones in the root directory.

Copy link
Member Author

Choose a reason for hiding this comment

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

sorry I'm not sure I follow. Why doesn't sklearn.pipeline._name_estimators qualify as "classes/functions which are private because their name has a leading underscore eventhough the path may be public"?


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 files in sub-packages is deprecated:
you should use ``from sklearn.cluster import Birch`` instead of ``from
NicolasHug marked this conversation as resolved.
Show resolved Hide resolved
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 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 +147,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 Down Expand Up @@ -336,14 +378,6 @@ Changelog
estimator's constructor but not stored as attributes on the instance.
:pr:`14464` by `Joel Nothman`_.

:mod:`sklearn.hierarchical`
...........................

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

:mod:`sklearn.impute`
.....................

Expand Down Expand Up @@ -525,8 +559,8 @@ Changelog
:pr:`14732` by :user:`Agamemnon Krasoulis <agamemnonc>`.

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

:mod:`sklearn.model_selection`
..............................
Expand Down