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

DOC add release highlights for 1.0 #20980

Merged
merged 33 commits into from
Sep 19, 2021
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7eaf391
DOC add release highlights for 1.0
adrinjalali Sep 8, 2021
af67279
Update examples/release_highlights/plot_release_highlights_1_0.py
adrinjalali Sep 9, 2021
7e91d35
Update examples/release_highlights/plot_release_highlights_1_0.py
adrinjalali Sep 9, 2021
8b830f0
Update examples/release_highlights/plot_release_highlights_1_0.py
adrinjalali Sep 9, 2021
07cb4d9
Update examples/release_highlights/plot_release_highlights_1_0.py
adrinjalali Sep 9, 2021
9b2b4fb
Update examples/release_highlights/plot_release_highlights_1_0.py
adrinjalali Sep 9, 2021
da41d0a
Update examples/release_highlights/plot_release_highlights_1_0.py
adrinjalali Sep 9, 2021
ce13899
Update examples/release_highlights/plot_release_highlights_1_0.py
adrinjalali Sep 9, 2021
0711264
Update examples/release_highlights/plot_release_highlights_1_0.py
adrinjalali Sep 9, 2021
5781c75
Update examples/release_highlights/plot_release_highlights_1_0.py
adrinjalali Sep 9, 2021
c2bc93b
Update examples/release_highlights/plot_release_highlights_1_0.py
adrinjalali Sep 9, 2021
e7458f7
Update examples/release_highlights/plot_release_highlights_1_0.py
adrinjalali Sep 9, 2021
58bdcf1
apply more suggestions
adrinjalali Sep 9, 2021
7513f1c
add another Display, and add documentation improvement measures
adrinjalali Sep 9, 2021
03b3c04
fix a few more links
adrinjalali Sep 9, 2021
5ee60cf
remove X
adrinjalali Sep 9, 2021
500b5f6
[doc build]
adrinjalali Sep 9, 2021
83e55af
DOC Adds feature names support into release notes
thomasjpfan Sep 11, 2021
28a4174
DOC Rename to 1_0_0
thomasjpfan Sep 11, 2021
6da7088
CLN Address comments
thomasjpfan Sep 11, 2021
e10cc3d
try figure fixes and fixes in feature names
adrinjalali Sep 11, 2021
fb31482
[doc build]
adrinjalali Sep 11, 2021
ade2804
Update examples/release_highlights/plot_release_highlights_1_0_0.py
adrinjalali Sep 19, 2021
4d9ac61
Update examples/release_highlights/plot_release_highlights_1_0_0.py
adrinjalali Sep 19, 2021
ade63ac
Update examples/release_highlights/plot_release_highlights_1_0_0.py
adrinjalali Sep 19, 2021
d7d6d0e
Update examples/release_highlights/plot_release_highlights_1_0_0.py
adrinjalali Sep 19, 2021
219a586
Update examples/release_highlights/plot_release_highlights_1_0_0.py
adrinjalali Sep 19, 2021
2a11c10
Update examples/release_highlights/plot_release_highlights_1_0_0.py
adrinjalali Sep 19, 2021
8de0767
Update examples/release_highlights/plot_release_highlights_1_0_0.py
adrinjalali Sep 19, 2021
3d7bdcc
Update examples/release_highlights/plot_release_highlights_1_0_0.py
adrinjalali Sep 19, 2021
60e522f
Update examples/release_highlights/plot_release_highlights_1_0_0.py
adrinjalali Sep 19, 2021
97ea98e
Update examples/release_highlights/plot_release_highlights_1_0_0.py
adrinjalali Sep 19, 2021
25cf711
cleanup
adrinjalali Sep 19, 2021
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
180 changes: 180 additions & 0 deletions examples/release_highlights/plot_release_highlights_1_0.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# flake8: noqa
"""
=======================================
Release Highlights for scikit-learn 1.0
=======================================

.. currentmodule:: sklearn

We are pleased to announce the release of scikit-learn 1.0! The library has
lorentzenchr marked this conversation as resolved.
Show resolved Hide resolved
been stable for quite some time, releasing version 1.0 is recognizing that and
signalling it to our users. The release does not include any braking changes,
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved
and as usual, and we do our best to follow a two release deprecation cycle for
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved
any breaking changes.

This release includes many bug fixes and improvements, as well as some new key
features. We detail below a few of the major features of this release. **For an
lorentzenchr marked this conversation as resolved.
Show resolved Hide resolved
exhaustive list of all the changes**, please refer to the :ref:`release notes
<changes_1_0>`.

To install the latest version (with pip)::

pip install --upgrade scikit-learn

or with conda::

conda install -c conda-forge scikit-learn
"""

##############################################################################
# keyword and positional arguments
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved
# ---------------------------------------------------------
# The scikit-learn API exposes many functions and methods which have many input
# parameters. For example, before this release, one could instantiate a
# `ensemble.HistGradientBoostingRegressor` as::
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved
#
# HistGradientBoostingRegressor("squared_error", 0.1, 100, 31, None,
# 20, 0.0, 255, None, None, False, "auto", "loss", 0.1, 10, 1e-7,
lorentzenchr marked this conversation as resolved.
Show resolved Hide resolved
# 0, None)
#
# Understanding the above code requires the reader to go to the API
# documentation to check each parameter, and what they mean, with the position
# they have. To improve the readability of code written based on scikit-learn,
lorentzenchr marked this conversation as resolved.
Show resolved Hide resolved
# now users have to provide most parameters with their names, as keyword
# arguments, instead of positional arguments. For example, the above code would
# be::
#
# HistGradientBoostingRegressor(
# loss="squared_error",
# learning_rate=0.1,
# max_iter=100,
# max_leaf_nodes=31,
# max_depth=None,
# min_samples_leaf=20,
# l2_regularization=0.0,
# max_bins=255,
# categorical_features=None,
# monotonic_cst=None,
# warm_start=False,
# early_stopping="auto",
# scoring="loss",
# validation_fraction=0.1,
# n_iter_no_change=10,
# tol=1e-7,
# verbose=0,
# random_state=None,
# )
#
# which is much more readable.
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved

##############################################################################
# Spline Transformers
# ---------------------------------------------------------
# One way to add nonlinear terms the dataset's feature set is to generate
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved
# spline basis functions for each feature with the
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved
# :class:`preprocessing.SplineTransformer`. Splines are piecewise polynomials,
# parametrized by their polynomial degree and the positions of the knots. The
# :class:`preprocessingSplineTransformer` implements a B-spline basis
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved

# .. figure:: ../linear_model/images/sphx_glr_plot_polynomial_interpolation_001.png
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved
# :target: ../linear_model/plot_successive_halving_iterations.html
# :align: center

# The following code shows splines in action, for more information, please
# refer to :ref:`User Guide <spline_transformer>`
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved

import numpy as np
from sklearn.preprocessing import SplineTransformer

X = np.arange(5).reshape(5, 1)
X
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved
spline = SplineTransformer(degree=2, n_knots=3)
spline.fit_transform(X)


##############################################################################
# Quantile Regressor
# --------------------------------------------------------------------------
# Quantile regression estimates the median or other quantiles of :math:`y`
# conditional on :math:`X`, while ordinary least squares (OLS) estimates the
# conditional mean.
#
# As a linear model, the :class:`QuantileRegressor` gives linear predictions
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved
# :math:`\hat{y}(w, X) = Xw` for the :math:`q`-th quantile, :math:`q \in (0,
# 1)`. The weights or coefficients :math:`w` are then found by the following
# minimization problem:

adrinjalali marked this conversation as resolved.
Show resolved Hide resolved
# .. math::
# \min_{w} {\frac{1}{n_{\text{samples}}}
# \sum_i PB_q(y_i - X_i w) + \alpha ||w||_1}.

# This consists of the pinball loss (also known as linear loss),
# see also :class:`~sklearn.metrics.mean_pinball_loss`,

# .. math::
# PB_q(t) = q \max(t, 0) + (1 - q) \max(-t, 0) =
# \begin{cases}
# q t, & t > 0, \\
# 0, & t = 0, \\
# (1-q) t, & t < 0
# \end{cases}
#
# and the L1 penalty controlled by parameter ``alpha``, similar to
# :class:`linear_model.Lasso`.
#
# Please check the following example to see how it works, and the :ref:`User
# Guide <quantile_regression>` for more details.

# .. figure:: /auto_examples/linear_model/images/sphx_glr_plot_quantile_regression_002.png
# :target: ../auto_examples/linear_model/plot_quantile_regression.html
# :align: center
# :scale: 50%

##############################################################################
# `from_estimator` and `from_predictions` on `*Display` classes
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved
# --------------------------------------------------------------------------
# :class:`metrics.ConfusionMatrixDisplay`,
# :class:`metrics.PrecisionRecallDisplay`, and :class:`metrics.DetCurveDisplay`
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved
# now expose two class methods: `from_estimator` and `from_predictions` which
# allow users to create a plot given the predictions or an estimator. This
# means the corresponsing `plot_*` functions are deprecated. Please check
# :ref:`example one
# <sphx_glr_auto_examples_model_selection_plot_confusion_matrix.py>` and
# :ref:`example two
# <sphx_glr_auto_examples_classification_plot_digits_classification.py>` for
# examples of how to use the new plotting functionalities.

##############################################################################
# Online One-Class SVM
# --------------------------------------------------------------------------
# The class :class:`sklearn.linear_model.SGDOneClassSVM` implements an online
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved
# linear version of the One-Class SVM using a stochastic gradient descent.
# Combined with kernel approximation techniques,
# :class:`sklearn.linear_model.SGDOneClassSVM` can be used to approximate the
# solution of a kernelized One-Class SVM, implemented in
# :class:`sklearn.svm.OneClassSVM`, with a linear complexity in the number of
# samples. Note that the complexity of a kernelized One-Class SVM is at best
# quadratic in the number of samples.
# :class:`sklearn.linear_model.SGDOneClassSVM` is thus well suited for datasets
# with a large number of training samples (> 10,000) for which the SGD variant
# can be several orders of magnitude faster. Please check this :ref:`example
# <sphx_glr_auto_examples_miscellaneous_plot_anomaly_comparison.py` to see how
# it's used, and :ref:`User Guide <sgd_online_one_class_svm>` for more details.

# .. figure:: /auto_examples/miscellaneous/images/sphx_glr_plot_anomaly_comparison_001.png
# :target: ../auto_examples/miscellaneous/plot_anomaly_comparison.html
# :align: center

##############################################################################
# Histogram Based Gradient Boosting Models
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved
# --------------------------------------------------------------------------
# `ensemble.HistGradientBoostingRegressor` and
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved
# `ensemble.HistGradientBoostingClassifier` are no longer experimental and can
# simply be imported and used as::
#
# from sklearn.ensemble import HistGradientBoostingClassifier

##############################################################################
# New documentation improvements
# ------------------------------
# TODO
adrinjalali marked this conversation as resolved.
Show resolved Hide resolved