Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit aeb79ca

Browse filesBrowse files
committed
Merge branch 'main' into pairwise-distances-radius-neighborhood
2 parents 37b61e3 + 998e8f2 commit aeb79ca
Copy full SHA for aeb79ca

File tree

306 files changed

+4661
-3987
lines changed
Filter options

Some content is hidden

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

306 files changed

+4661
-3987
lines changed

‎.git-blame-ignore-revs

Copy file name to clipboardExpand all lines: .git-blame-ignore-revs
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@
1919

2020
# PR 20502: Runs Black on examples
2121
70a185ae59b4362633d18b0d0083abb1b6f7370c
22+
23+
# PR 22474: Update to Black 22.1.0
24+
1fc86b6aacd89da44a3b4e8abf7c3e2ba4336ffe

‎.github/workflows/assign.yml

Copy file name to clipboardExpand all lines: .github/workflows/assign.yml
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ on:
77
jobs:
88
one:
99
runs-on: ubuntu-latest
10+
# Note that string comparisons is not case sensitive.
1011
if: >-
11-
(github.event.comment.body == 'take' ||
12-
github.event.comment.body == 'Take')
13-
&& !github.event.issue.assignee
12+
startsWith(github.event.comment.body, '/take')
13+
&& !github.event.issue.assignee
1414
steps:
1515
- run: |
1616
echo "Assigning issue ${{ github.event.issue.number }} to ${{ github.event.comment.user.login }}"

‎.github/workflows/check-changelog.yml

Copy file name to clipboardExpand all lines: .github/workflows/check-changelog.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ jobs:
6161
echo "If you see this error and there is already a changelog entry,"
6262
echo "check that the PR number is correct."
6363
echo ""
64-
echo "If you believe that this PR does no warrant a changelog"
65-
echo "entry, say so in a comment so that a maintainer will label "
64+
echo "If you believe that this PR does not warrant a changelog"
65+
echo "entry, say so in a comment so that a maintainer will label"
6666
echo "the PR with 'No Changelog Needed' to bypass this check."
6767
exit 1
6868
fi

‎.github/workflows/check-manifest.yml

Copy file name to clipboardExpand all lines: .github/workflows/check-manifest.yml
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66

77
jobs:
88
check:
9+
# Don't run on forks
10+
if: github.repository == 'scikit-learn/scikit-learn'
11+
912
runs-on: ubuntu-latest
1013
steps:
1114
- uses: actions/checkout@v2

‎.github/workflows/wheels.yml

Copy file name to clipboardExpand all lines: .github/workflows/wheels.yml
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ jobs:
4949
matrix:
5050
include:
5151
# Window 64 bit
52-
- os: windows-latest
52+
# Note: windows-2019 is needed for older Python versions:
53+
# https://github.com/scikit-learn/scikit-learn/issues/22530
54+
- os: windows-2019
5355
python: 37
5456
bitness: 64
5557
platform_id: win_amd64
56-
- os: windows-latest
58+
- os: windows-2019
5759
python: 38
5860
bitness: 64
5961
platform_id: win_amd64

‎.gitignore

Copy file name to clipboardExpand all lines: .gitignore
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ _configtest.o.d
7575
# Used by mypy
7676
.mypy_cache/
7777

78+
# virtualenv from advanced installation guide
79+
sklearn-env/
80+
7881
# files generated from a template
7982
sklearn/_loss/_loss.pyx
8083
sklearn/utils/_seq_dataset.pyx

‎.pre-commit-config.yaml

Copy file name to clipboardExpand all lines: .pre-commit-config.yaml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ repos:
66
- id: end-of-file-fixer
77
- id: trailing-whitespace
88
- repo: https://github.com/psf/black
9-
rev: 21.6b0
9+
rev: 22.1.0
1010
hooks:
1111
- id: black
1212
- repo: https://gitlab.com/pycqa/flake8

‎README.rst

Copy file name to clipboardExpand all lines: README.rst
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
.. |PythonMinVersion| replace:: 3.7
3636
.. |NumPyMinVersion| replace:: 1.14.6
3737
.. |SciPyMinVersion| replace:: 1.1.0
38-
.. |JoblibMinVersion| replace:: 0.11
38+
.. |JoblibMinVersion| replace:: 1.0.0
3939
.. |ThreadpoolctlMinVersion| replace:: 2.0.0
4040
.. |MatplotlibMinVersion| replace:: 2.2.3
4141
.. |Scikit-ImageMinVersion| replace:: 0.14.5
@@ -89,7 +89,7 @@ User installation
8989
~~~~~~~~~~~~~~~~~
9090

9191
If you already have a working installation of numpy and scipy,
92-
the easiest way to install scikit-learn is using ``pip`` ::
92+
the easiest way to install scikit-learn is using ``pip``::
9393

9494
pip install -U scikit-learn
9595

@@ -184,6 +184,8 @@ Communication
184184

185185
- Mailing list: https://mail.python.org/mailman/listinfo/scikit-learn
186186
- Gitter: https://gitter.im/scikit-learn/scikit-learn
187+
- Blog: https://blog.scikit-learn.org
188+
- Calendar: https://blog.scikit-learn.org/calendar/
187189
- Twitter: https://twitter.com/scikit_learn
188190
- Twitter (commits): https://twitter.com/sklearn_commits
189191
- Stack Overflow: https://stackoverflow.com/questions/tagged/scikit-learn
@@ -193,6 +195,7 @@ Communication
193195
- YouTube: https://www.youtube.com/channel/UCJosFjYm0ZYVUARxuOZqnnw/playlists
194196
- Facebook: https://www.facebook.com/scikitlearnofficial/
195197
- Instagram: https://www.instagram.com/scikitlearnofficial/
198+
- TikTok: https://www.tiktok.com/@scikit.learn
196199

197200
Citation
198201
~~~~~~~~

‎azure-pipelines.yml

Copy file name to clipboardExpand all lines: azure-pipelines.yml
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
versionSpec: '3.9'
4646
- bash: |
4747
# Include pytest compatibility with mypy
48-
pip install pytest flake8 mypy==0.782 black==21.6b0
48+
pip install pytest flake8 mypy==0.782 black==22.1.0
4949
displayName: Install linters
5050
- bash: |
5151
black --check --diff .
@@ -190,7 +190,7 @@ jobs:
190190
PANDAS_VERSION: 'none'
191191
THREADPOOLCTL_VERSION: 'min'
192192
COVERAGE: 'false'
193-
# Linux + Python 3.7 build with OpenBLAS and without SITE_JOBLIB
193+
# Linux + Python 3.7 build with OpenBLAS
194194
py37_conda_defaults_openblas:
195195
DISTRIB: 'conda'
196196
CONDA_CHANNEL: 'defaults' # Anaconda main channel
@@ -206,6 +206,7 @@ jobs:
206206
pylatest_pip_openblas_pandas:
207207
DISTRIB: 'conda-pip-latest'
208208
PYTHON_VERSION: '3.9'
209+
PYTEST_VERSION: '6.2.5'
209210
CHECK_PYTEST_SOFT_DEPENDENCY: 'true'
210211
TEST_DOCSTRINGS: 'true'
211212
CHECK_WARNINGS: 'true'
@@ -273,7 +274,8 @@ jobs:
273274
PYTHON_VERSION: '3.7'
274275
CHECK_WARNINGS: 'true'
275276
PYTHON_ARCH: '64'
276-
PYTEST_VERSION: '*'
277+
# Unpin when pytest stalling issue is fixed
278+
PYTEST_VERSION: '6.2.5'
277279
COVERAGE: 'true'
278280
# Temporary fix for setuptools to use disutils from standard lib
279281
# https://github.com/numpy/numpy/issues/17216

‎benchmarks/bench_hist_gradient_boosting_threading.py

Copy file name to clipboardExpand all lines: benchmarks/bench_hist_gradient_boosting_threading.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def one_run(n_threads, n_samples):
239239

240240

241241
max_threads = os.cpu_count()
242-
n_threads_list = [2 ** i for i in range(8) if (2 ** i) < max_threads]
242+
n_threads_list = [2**i for i in range(8) if (2**i) < max_threads]
243243
n_threads_list.append(max_threads)
244244

245245
sklearn_scores = []

‎benchmarks/bench_isotonic.py

Copy file name to clipboardExpand all lines: benchmarks/bench_isotonic.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def bench_isotonic_regression(Y):
8686

8787
timings = []
8888
for exponent in range(args.log_min_problem_size, args.log_max_problem_size):
89-
n = 10 ** exponent
89+
n = 10**exponent
9090
Y = DATASET_GENERATORS[args.dataset](n)
9191
time_per_iteration = [
9292
bench_isotonic_regression(Y) for i in range(args.iterations)

‎benchmarks/bench_lasso.py

Copy file name to clipboardExpand all lines: benchmarks/bench_lasso.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def compute_bench(alpha, n_samples, n_features, precompute):
3939
coef=True,
4040
)
4141

42-
X /= np.sqrt(np.sum(X ** 2, axis=0)) # Normalize data
42+
X /= np.sqrt(np.sum(X**2, axis=0)) # Normalize data
4343

4444
gc.collect()
4545
print("- benchmarking Lasso")

‎benchmarks/bench_plot_nmf.py

Copy file name to clipboardExpand all lines: benchmarks/bench_plot_nmf.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def _fit_projected_gradient(X, W, H, tol, max_iter, nls_max_iter, alpha, l1_rati
162162
proj_grad_W = squared_norm(gradW * np.logical_or(gradW < 0, W > 0))
163163
proj_grad_H = squared_norm(gradH * np.logical_or(gradH < 0, H > 0))
164164

165-
if (proj_grad_W + proj_grad_H) / init_grad < tol ** 2:
165+
if (proj_grad_W + proj_grad_H) / init_grad < tol**2:
166166
break
167167

168168
# update W

‎benchmarks/bench_plot_randomized_svd.py

Copy file name to clipboardExpand all lines: benchmarks/bench_plot_randomized_svd.py
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@
5050
5151
References
5252
----------
53-
(1) Finding structure with randomness: Stochastic algorithms for constructing
54-
approximate matrix decompositions
55-
Halko, et al., 2009 https://arxiv.org/abs/0909.4061
53+
(1) :arxiv:`"Finding structure with randomness:
54+
Stochastic algorithms for constructing approximate matrix decompositions."
55+
<0909.4061>`
56+
Halko, et al., (2009)
5657
5758
(2) A randomized algorithm for the decomposition of matrices
5859
Per-Gunnar Martinsson, Vladimir Rokhlin and Mark Tygert

‎benchmarks/bench_random_projections.py

Copy file name to clipboardExpand all lines: benchmarks/bench_random_projections.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def type_auto_or_int(val):
3838

3939

4040
def compute_time(t_start, delta):
41-
mu_second = 0.0 + 10 ** 6 # number of microseconds in a second
41+
mu_second = 0.0 + 10**6 # number of microseconds in a second
4242

4343
return delta.seconds + delta.microseconds / mu_second
4444

@@ -109,7 +109,7 @@ def print_row(clf_type, time_fit, time_transform):
109109
op.add_option(
110110
"--n-features",
111111
dest="n_features",
112-
default=10 ** 4,
112+
default=10**4,
113113
type=int,
114114
help="Number of features in the benchmarks",
115115
)
@@ -124,7 +124,7 @@ def print_row(clf_type, time_fit, time_transform):
124124
op.add_option(
125125
"--ratio-nonzeros",
126126
dest="ratio_nonzeros",
127-
default=10 ** -3,
127+
default=10**-3,
128128
type=float,
129129
help="Number of features in the benchmarks",
130130
)

‎benchmarks/bench_rcv1_logreg_convergence.py

Copy file name to clipboardExpand all lines: benchmarks/bench_rcv1_logreg_convergence.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def plot_dloss(clfs):
149149

150150
def get_max_squared_sum(X):
151151
"""Get the maximum row-wise sum of squares"""
152-
return np.sum(X ** 2, axis=1).max()
152+
return np.sum(X**2, axis=1).max()
153153

154154

155155
rcv1 = fetch_rcv1()

‎benchmarks/bench_saga.py

Copy file name to clipboardExpand all lines: benchmarks/bench_saga.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def fit_single(
119119
# Lightning predict_proba is not implemented for n_classes > 2
120120
y_pred = _predict_proba(lr, X)
121121
score = log_loss(y, y_pred, normalize=False) / n_samples
122-
score += 0.5 * alpha * np.sum(lr.coef_ ** 2) + beta * np.sum(
122+
score += 0.5 * alpha * np.sum(lr.coef_**2) + beta * np.sum(
123123
np.abs(lr.coef_)
124124
)
125125
scores.append(score)

‎benchmarks/bench_sample_without_replacement.py

Copy file name to clipboardExpand all lines: benchmarks/bench_sample_without_replacement.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
def compute_time(t_start, delta):
19-
mu_second = 0.0 + 10 ** 6 # number of microseconds in a second
19+
mu_second = 0.0 + 10**6 # number of microseconds in a second
2020

2121
return delta.seconds + delta.microseconds / mu_second
2222

‎benchmarks/bench_tree.py

Copy file name to clipboardExpand all lines: benchmarks/bench_tree.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
scikit_classifier_results = []
2323
scikit_regressor_results = []
2424

25-
mu_second = 0.0 + 10 ** 6 # number of microseconds in a second
25+
mu_second = 0.0 + 10**6 # number of microseconds in a second
2626

2727

2828
def bench_scikit_tree_classifier(X, Y):

‎build_tools/azure/install.sh

Copy file name to clipboardExpand all lines: build_tools/azure/install.sh
+2-12Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,7 @@ if [[ "$DISTRIB" == "conda" || "$DISTRIB" == *"mamba"* ]]; then
6363

6464
if [[ "$UNAMESTR" == "Darwin" ]]; then
6565
if [[ "$SKLEARN_TEST_NO_OPENMP" != "true" ]]; then
66-
# on macOS, install an OpenMP-enabled clang/llvm from conda-forge.
67-
# TODO: Remove !=1.1.0 when the following is fixed:
68-
# sklearn/svm/_libsvm.cpython-38-darwin.so,
69-
# 2): Symbol not found: _svm_check_parameter error
70-
TO_INSTALL="$TO_INSTALL compilers>=1.0.4,!=1.1.0 llvm-openmp"
66+
TO_INSTALL="$TO_INSTALL compilers llvm-openmp"
7167
else
7268
# Without openmp, we use the system clang. Here we use /usr/bin/ar
7369
# instead because llvm-ar errors
@@ -142,16 +138,10 @@ if [[ "$COVERAGE" == "true" ]]; then
142138
python -m pip install codecov pytest-cov coverage==6.2
143139
fi
144140

145-
if [[ "$PYTEST_XDIST_VERSION" != "none" ]]; then
146-
python -m pip install pytest-xdist
147-
fi
148-
149141
if [[ "$TEST_DOCSTRINGS" == "true" ]]; then
150142
# numpydoc requires sphinx
151143
python -m pip install sphinx
152-
# TODO: update the docstring checks to be compatible with new
153-
# numpydoc versions
154-
python -m pip install "numpydoc<1.2"
144+
python -m pip install numpydoc
155145
fi
156146

157147
python --version

‎build_tools/azure/posix.yml

Copy file name to clipboardExpand all lines: build_tools/azure/posix.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
PYAMG_VERSION: 'latest'
3131
PILLOW_VERSION: 'latest'
3232
MATPLOTLIB_VERSION: 'latest'
33-
PYTEST_VERSION: 'latest'
33+
PYTEST_VERSION: '6.2.5'
3434
# Disable pytest-xdist as it can stall builds
3535
PYTEST_XDIST_VERSION: 'latest'
3636
THREADPOOLCTL_VERSION: 'latest'

‎build_tools/circle/build_test_arm.sh

Copy file name to clipboardExpand all lines: build_tools/circle/build_test_arm.sh
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fi
6262
if [[ "$TEST_DOCSTRINGS" == "true" ]]; then
6363
# numpydoc requires sphinx
6464
mamba install --verbose -y sphinx
65-
mamba install --verbose -y "numpydoc<1.2"
65+
mamba install --verbose -y numpydoc
6666
fi
6767

6868
python --version

‎doc/about.rst

Copy file name to clipboardExpand all lines: doc/about.rst
+4-30Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -244,19 +244,18 @@ July 2017.
244244
<div class="sk-sponsor-div">
245245
<div class="sk-sponsor-div-box">
246246

247-
`Zalando SE <https://corporate.zalando.com/en>`_ funds Adrin Jalali since
248-
August 2020.
247+
`Hugging Face <https://huggingface.co/>`_ funds Adrin Jalali since 2022.
249248

250249
.. raw:: html
251250

252251
</div>
253252

254253
<div class="sk-sponsor-div-box">
255254

256-
.. image:: images/zalando_logo.png
257-
:width: 100pt
255+
.. image:: images/huggingface_logo-noborder.png
256+
:width: 55pt
258257
:align: center
259-
:target: https://corporate.zalando.com/en
258+
:target: https://huggingface.co/
260259

261260
.. raw:: html
262261

@@ -423,31 +422,6 @@ time of Joris van den Bossche (2017-2018).
423422
</div>
424423
</div>
425424

426-
............
427-
428-
.. raw:: html
429-
430-
<div class="sk-sponsor-div">
431-
<div class="sk-sponsor-div-box">
432-
433-
`Anaconda, Inc <https://www.anaconda.com/>`_ funded Adrin Jalali in 2019.
434-
435-
.. raw:: html
436-
437-
</div>
438-
439-
<div class="sk-sponsor-div-box">
440-
441-
.. image:: images/anaconda.png
442-
:width: 100pt
443-
:align: center
444-
:target: https://www.anaconda.com/
445-
446-
.. raw:: html
447-
448-
</div>
449-
</div>
450-
451425
..........................
452426

453427
.. raw:: html

‎doc/computing/parallelism.rst

Copy file name to clipboardExpand all lines: doc/computing/parallelism.rst
-15Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -179,21 +179,6 @@ Environment variables
179179

180180
These environment variables should be set before importing scikit-learn.
181181

182-
:SKLEARN_SITE_JOBLIB:
183-
184-
When this environment variable is set to a non zero value,
185-
scikit-learn uses the site joblib rather than its vendored version.
186-
Consequently, joblib must be installed for scikit-learn to run.
187-
Note that using the site joblib is at your own risks: the versions of
188-
scikit-learn and joblib need to be compatible. Currently, joblib 0.11+
189-
is supported. In addition, dumps from joblib.Memory might be incompatible,
190-
and you might loose some caches and have to redownload some datasets.
191-
192-
.. deprecated:: 0.21
193-
194-
As of version 0.21 this parameter has no effect, vendored joblib was
195-
removed and site joblib is always used.
196-
197182
:SKLEARN_ASSUME_FINITE:
198183

199184
Sets the default value for the `assume_finite` argument of

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.