Skip to content

Commit bba3129

Browse files
committed
Pushing the docs to dev/ for branch: main, commit 90209c8cdda28462b0c199f3704721b5cc9923c9
1 parent c4f233f commit bba3129

File tree

1,576 files changed

+17949
-12344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,576 files changed

+17949
-12344
lines changed

dev/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: de3bed91b405c599f604c5b2fb0cf79c
3+
config: e007e4d79dc485567e1670cec5430da4
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# ruff: noqa: CPY001
2+
"""
3+
=======================================
4+
Release Highlights for scikit-learn 1.7
5+
=======================================
6+
7+
.. currentmodule:: sklearn
8+
9+
We are pleased to announce the release of scikit-learn 1.7! Many bug fixes
10+
and improvements were added, as well as some key new features. Below we
11+
detail the highlights of this release. **For an exhaustive list of
12+
all the changes**, please refer to the :ref:`release notes <release_notes_1_7>`.
13+
14+
To install the latest version (with pip)::
15+
16+
pip install --upgrade scikit-learn
17+
18+
or with conda::
19+
20+
conda install -c conda-forge scikit-learn
21+
22+
"""
23+
24+
# %%
25+
# Improved estimator's HTML representation
26+
# ----------------------------------------
27+
# The HTML representation of estimators now includes a section containing the list of
28+
# parameters and their values. Non-default parameters are highlighted in orange. A copy
29+
# button is also available to copy the "fully-qualified" parameter name without the
30+
# need to call the `get_params` method. It is particularly useful when defining a
31+
# parameter grid for a grid-search or a randomized-search with a complex pipeline.
32+
#
33+
# See the example below and click on the different estimator's blocks to see the
34+
# improved HTML representation.
35+
36+
from sklearn.linear_model import LogisticRegression
37+
from sklearn.pipeline import make_pipeline
38+
from sklearn.preprocessing import StandardScaler
39+
40+
model = make_pipeline(StandardScaler(with_std=False), LogisticRegression(C=2.0))
41+
model
42+
43+
# %%
44+
# Custom validation set for histogram-based Gradient Boosting estimators
45+
# ----------------------------------------------------------------------
46+
# The :class:`ensemble.HistGradientBoostingClassifier` and
47+
# :class:`ensemble.HistGradientBoostingRegressor` now support directly passing a custom
48+
# validation set for early stopping to the `fit` method, using the `X_val`, `y_val`, and
49+
# `sample_weight_val` parameters.
50+
# In a :class:`pipeline.Pipeline`, the validation set `X_val` can be transformed along
51+
# with `X` using the `transform_input` parameter.
52+
53+
import sklearn
54+
from sklearn.datasets import make_classification
55+
from sklearn.ensemble import HistGradientBoostingClassifier
56+
from sklearn.model_selection import train_test_split
57+
from sklearn.pipeline import Pipeline
58+
from sklearn.preprocessing import StandardScaler
59+
60+
sklearn.set_config(enable_metadata_routing=True)
61+
62+
X, y = make_classification(random_state=0)
63+
X_train, X_val, y_train, y_val = train_test_split(X, y, test_size=0.2, random_state=0)
64+
65+
clf = HistGradientBoostingClassifier()
66+
clf.set_fit_request(X_val=True, y_val=True)
67+
68+
model = Pipeline([("sc", StandardScaler()), ("clf", clf)], transform_input=["X_val"])
69+
model.fit(X, y, X_val=X_val, y_val=y_val)
70+
71+
# %%
72+
# Plotting ROC curves from cross-validation results
73+
# -------------------------------------------------
74+
# The class :class:`metrics.RocCurveDisplay` has a new class method `from_cv_results`
75+
# that allows to easily plot multiple ROC curves from the results of
76+
# :func:`model_selection.cross_validate`.
77+
78+
from sklearn.datasets import make_classification
79+
from sklearn.linear_model import LogisticRegression
80+
from sklearn.metrics import RocCurveDisplay
81+
from sklearn.model_selection import cross_validate
82+
83+
X, y = make_classification(n_samples=150, random_state=0)
84+
clf = LogisticRegression(random_state=0)
85+
cv_results = cross_validate(clf, X, y, cv=5, return_estimator=True, return_indices=True)
86+
_ = RocCurveDisplay.from_cv_results(cv_results, X, y)
87+
88+
# %%
89+
# Array API support
90+
# -----------------
91+
# Several functions have been updated to support array API compatible inputs since
92+
# version 1.6, especially metrics from the :mod:`sklearn.metrics` module.
93+
#
94+
# In addition, it is no longer required to install the `array-api-compat` package to use
95+
# the experimental array API support in scikit-learn.
96+
#
97+
# Please refer to the :ref:`array API support<array_api>` page for instructions to use
98+
# scikit-learn with array API compatible libraries such as PyTorch or CuPy.
99+
100+
# %%
101+
# Improved API consistency of Multi-layer Perceptron
102+
# --------------------------------------------------
103+
# The :class:`neural_network.MLPRegressor` has a new parameter `loss` and now supports
104+
# the "poisson" loss in addition to the default "squared_error" loss.
105+
# Moreover, the :class:`neural_network.MLPClassifier` and
106+
# :class:`neural_network.MLPRegressor` estimators now support sample weights.
107+
# These improvements have been made to improve the consistency of these estimators
108+
# with regard to the other estimators in scikit-learn.
109+
110+
# %%
111+
# Migration toward sparse arrays
112+
# ------------------------------
113+
# In order to prepare `SciPy migration from sparse matrices to sparse arrays <https://docs.scipy.org/doc/scipy/reference/sparse.migration_to_sparray.html>`_,
114+
# all scikit-learn estimators that accept sparse matrices as input now also accept
115+
# sparse arrays.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"\n# Release Highlights for scikit-learn 1.7\n\n.. currentmodule:: sklearn\n\nWe are pleased to announce the release of scikit-learn 1.7! Many bug fixes\nand improvements were added, as well as some key new features. Below we\ndetail the highlights of this release. **For an exhaustive list of\nall the changes**, please refer to the `release notes <release_notes_1_7>`.\n\nTo install the latest version (with pip)::\n\n pip install --upgrade scikit-learn\n\nor with conda::\n\n conda install -c conda-forge scikit-learn\n"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"## Improved estimator's HTML representation\nThe HTML representation of estimators now includes a section containing the list of\nparameters and their values. Non-default parameters are highlighted in orange. A copy\nbutton is also available to copy the \"fully-qualified\" parameter name without the\nneed to call the `get_params` method. It is particularly useful when defining a\nparameter grid for a grid-search or a randomized-search with a complex pipeline.\n\nSee the example below and click on the different estimator's blocks to see the\nimproved HTML representation.\n\n"
15+
]
16+
},
17+
{
18+
"cell_type": "code",
19+
"execution_count": null,
20+
"metadata": {
21+
"collapsed": false
22+
},
23+
"outputs": [],
24+
"source": [
25+
"from sklearn.linear_model import LogisticRegression\nfrom sklearn.pipeline import make_pipeline\nfrom sklearn.preprocessing import StandardScaler\n\nmodel = make_pipeline(StandardScaler(with_std=False), LogisticRegression(C=2.0))\nmodel"
26+
]
27+
},
28+
{
29+
"cell_type": "markdown",
30+
"metadata": {},
31+
"source": [
32+
"## Custom validation set for histogram-based Gradient Boosting estimators\nThe :class:`ensemble.HistGradientBoostingClassifier` and\n:class:`ensemble.HistGradientBoostingRegressor` now support directly passing a custom\nvalidation set for early stopping to the `fit` method, using the `X_val`, `y_val`, and\n`sample_weight_val` parameters.\nIn a :class:`pipeline.Pipeline`, the validation set `X_val` can be transformed along\nwith `X` using the `transform_input` parameter.\n\n"
33+
]
34+
},
35+
{
36+
"cell_type": "code",
37+
"execution_count": null,
38+
"metadata": {
39+
"collapsed": false
40+
},
41+
"outputs": [],
42+
"source": [
43+
"import sklearn\nfrom sklearn.datasets import make_classification\nfrom sklearn.ensemble import HistGradientBoostingClassifier\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.preprocessing import StandardScaler\n\nsklearn.set_config(enable_metadata_routing=True)\n\nX, y = make_classification(random_state=0)\nX_train, X_val, y_train, y_val = train_test_split(X, y, test_size=0.2, random_state=0)\n\nclf = HistGradientBoostingClassifier()\nclf.set_fit_request(X_val=True, y_val=True)\n\nmodel = Pipeline([(\"sc\", StandardScaler()), (\"clf\", clf)], transform_input=[\"X_val\"])\nmodel.fit(X, y, X_val=X_val, y_val=y_val)"
44+
]
45+
},
46+
{
47+
"cell_type": "markdown",
48+
"metadata": {},
49+
"source": [
50+
"## Plotting ROC curves from cross-validation results\nThe class :class:`metrics.RocCurveDisplay` has a new class method `from_cv_results`\nthat allows to easily plot multiple ROC curves from the results of\n:func:`model_selection.cross_validate`.\n\n"
51+
]
52+
},
53+
{
54+
"cell_type": "code",
55+
"execution_count": null,
56+
"metadata": {
57+
"collapsed": false
58+
},
59+
"outputs": [],
60+
"source": [
61+
"from sklearn.datasets import make_classification\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.metrics import RocCurveDisplay\nfrom sklearn.model_selection import cross_validate\n\nX, y = make_classification(n_samples=150, random_state=0)\nclf = LogisticRegression(random_state=0)\ncv_results = cross_validate(clf, X, y, cv=5, return_estimator=True, return_indices=True)\n_ = RocCurveDisplay.from_cv_results(cv_results, X, y)"
62+
]
63+
},
64+
{
65+
"cell_type": "markdown",
66+
"metadata": {},
67+
"source": [
68+
"## Array API support\nSeveral functions have been updated to support array API compatible inputs since\nversion 1.6, especially metrics from the :mod:`sklearn.metrics` module.\n\nIn addition, it is no longer required to install the `array-api-compat` package to use\nthe experimental array API support in scikit-learn.\n\nPlease refer to the `array API support<array_api>` page for instructions to use\nscikit-learn with array API compatible libraries such as PyTorch or CuPy.\n\n"
69+
]
70+
},
71+
{
72+
"cell_type": "markdown",
73+
"metadata": {},
74+
"source": [
75+
"## Improved API consistency of Multi-layer Perceptron\nThe :class:`neural_network.MLPRegressor` has a new parameter `loss` and now supports\nthe \"poisson\" loss in addition to the default \"squared_error\" loss.\nMoreover, the :class:`neural_network.MLPClassifier` and\n:class:`neural_network.MLPRegressor` estimators now support sample weights.\nThese improvements have been made to improve the consistency of these estimators\nwith regard to the other estimators in scikit-learn.\n\n"
76+
]
77+
},
78+
{
79+
"cell_type": "markdown",
80+
"metadata": {},
81+
"source": [
82+
"## Migration toward sparse arrays\nIn order to prepare [SciPy migration from sparse matrices to sparse arrays](https://docs.scipy.org/doc/scipy/reference/sparse.migration_to_sparray.html),\nall scikit-learn estimators that accept sparse matrices as input now also accept\nsparse arrays.\n\n"
83+
]
84+
}
85+
],
86+
"metadata": {
87+
"kernelspec": {
88+
"display_name": "Python 3",
89+
"language": "python",
90+
"name": "python3"
91+
},
92+
"language_info": {
93+
"codemirror_mode": {
94+
"name": "ipython",
95+
"version": 3
96+
},
97+
"file_extension": ".py",
98+
"mimetype": "text/x-python",
99+
"name": "python",
100+
"nbconvert_exporter": "python",
101+
"pygments_lexer": "ipython3",
102+
"version": "3.10.17"
103+
}
104+
},
105+
"nbformat": 4,
106+
"nbformat_minor": 0
107+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

dev/_downloads/scikit-learn-docs.zip

97.8 KB
Binary file not shown.
-394 Bytes
-55 Bytes
-57 Bytes

0 commit comments

Comments
 (0)