8000 Merge pull request #3 from scikit-learn/master · arka204/scikit-learn@15a658f · GitHub
[go: up one dir, main page]

Skip to content

Commit 15a658f

Browse files
authored
Merge pull request #3 from scikit-learn/master
Merging changes from the main repository
2 parents 464dc37 + a0a23d2 commit 15a658f

File tree

172 files changed

+2825
-2726
lines changed

Some content is hidden

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

172 files changed

+2825
-2726
lines changed

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ scikit-learn requires:
5151
- NumPy (>= 1.13.3)
5252
- SciPy (>= 0.19.1)
5353
- joblib (>= 0.11)
54+
- threadpoolctl (>= 2.0.0)
5455

5556
**Scikit-learn 0.20 was the last version to support Python 2.7 and Python 3.4.**
5657
scikit-learn 0.23 and later require Python 3.6 or newer.

azure-pipelines.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,30 @@ jobs:
1818
- bash: sudo chown -R $USER $CONDA
1919
displayName: Take ownership of conda installation
2020
- bash: |
21+
set -ex
2122
conda create --name flake8_env --yes python=3.8
22-
conda activate flake8_env
23+
source activate flake8_env
2324
pip install flake8 mypy==0.770
2425
displayName: Install flake8
2526
- bash: |
27+
set -ex
2628
if [[ $BUILD_SOURCEVERSIONMESSAGE =~ \[lint\ skip\] ]]; then
2729
# skip linting
2830
echo "Skipping linting"
2931
exit 0
3032
else
31-
conda activate flake8_env
33+
source activate flake8_env
3234
./build_tools/circle/linting.sh
3335
fi
3436
displayName: Run linting
3537
- bash: |
38+
set -ex
3639
if [[ $BUILD_SOURCEVERSIONMESSAGE =~ \[lint\ skip\] ]]; then
3740
# skip linting
3841
echo "Skipping linting"
3942
exit 0
4043
else
41-
conda activate flake8_env
44+
source activate flake8_env
4245
mypy sklearn/ --ignore-missing-imports
4346
fi
4447
displayName: Run mypy

build_tools/circle/linting.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,14 @@ then
161161
echo $bad_deprecation_property_order
162162
exit 1
163163
fi
164+
165+
# Check for default doctest directives ELLIPSIS and NORMALIZE_WHITESPACE
166+
167+
doctest_directive="$(git grep -nw -E "# doctest\: \+(ELLIPSIS|NORMALIZE_WHITESPACE)")"
168+
169+
if [ ! -z "$doctest_directive" ]
170+
then
171+
echo "ELLIPSIS and NORMALIZE_WHITESPACE doctest directives are enabled by default, but were found in:"
172+
echo "$doctest_directive"
173+
exit 1
174+
fi

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080

8181
# General information about the project.
8282
project = 'scikit-learn'
83-
copyright = '2007 - 2019, scikit-learn developers (BSD License)'
83+
copyright = '2007 - 2020, scikit-learn developers (BSD License)'
8484

8585
# The version info for the project you're documenting, acts as replacement for
8686
# |version| and |release|, also used in various other places throughout the

doc/developers/advanced_installation.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ runtime:
8989
- Python (>= 3.6),
9090
- NumPy (>= 1.13.3),
9191
- SciPy (>= 0.19),
92-
- Joblib (>= 0.11).
92+
- Joblib (>= 0.11),
93+
- threadpoolctl (>= 2.0.0).
9394

9495
Those dependencies are **automatically installed by pip** if they were missing
9596
when building scikit-learn from source.

doc/developers/contributing.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ See :ref:`new_contributors` to get started.
2222
We are a community based on openness and friendly, didactic,
2323
discussions.
2424

25-
We aspire to treat everybody equally, and value their contributions.
25+
We aspire to treat everybody equally, and value their contributions. We
26+
are particularly seeking people from underrepresented backgrounds in Open
27+
Source Software and scikit-learn in particular to participate and
28+
contribute their expertise and experience.
2629

2730
Decisions are made based on technical merit and consensus.
2831

doc/developers/develop.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,9 @@ several internals of scikit-learn that you should be aware of in addition to
247247
the scikit-learn API outlined above. You can check whether your estimator
248248
adheres to the scikit-learn interface and standards by running
249249
:func:`~sklearn.utils.estimator_checks.check_estimator` on an instance. The
250-
:func:`~sklearn.utils.parametrize_with_checks` pytest decorator can also be
251-
used (see its docstring for details and possible interactions with `pytest`)::
250+
:func:`~sklearn.utils.estimator_checks.parametrize_with_checks` pytest
251+
decorator can also be used (see its docstring for details and possible
252+
interactions with `pytest`)::
252253

253254
>>> from sklearn.utils.estimator_checks import check_estimator
254255
>>> from sklearn.svm import LinearSVC
@@ -525,9 +526,10 @@ _skip_test (default=False)
525526
_xfail_checks (default=False)
526527
dictionary ``{check_name: reason}`` of common checks that will be marked
527528 as `XFAIL` for pytest, when using
528-
:func:`~sklearn.utils.estimator_checks.parametrize_with_checks`. This tag
529-
currently has no effect on
530-
:func:`~sklearn.utils.estimator_checks.check_estimator`.
529+
:func:`~sklearn.utils.estimator_checks.parametrize_with_checks`. These
530+
checks will be simply ignored and not run by
531+
:func:`~sklearn.utils.estimator_checks.check_estimator`, but a
532+
`SkipTestWarning` will be raised.
531533
Don't use this unless there is a *very good* reason for your estimator
532534
not to pass the check.
533535
Also note that the usage of this tag is highly subject to change because

doc/modules/classes.rst

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ Samples generator
431431

432432
.. autosummary::
433433
:toctree: generated/
434-
:template: class_without_init.rst
434+
:template: class.rst
435435

436436
exceptions.ChangedBehaviorWarning
437437
exceptions.ConvergenceWarning
@@ -1620,12 +1620,5 @@ Utilities from joblib:
16201620
Recently deprecated
16211621
===================
16221622

1623-
To be removed in 0.24
1623+
To be removed in 0.25
16241624
---------------------
1625-
1626-
.. autosummary::
1627-
:toctree: generated/
1628-
:template: deprecated_function.rst
1629-
1630-
model_selection.fit_grid_point
1631-
utils.safe_indexing

doc/modules/compose.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,13 @@ the regressor that will be used for prediction, and the transformer that will
251251
be applied to the target variable::
252252

253253
>>> import numpy as np
254-
>>> from sklearn.datasets import load_boston
254+
>>> from sklearn.datasets import fetch_california_housing
255255
>>> from sklearn.compose import TransformedTargetRegressor
256256
>>> from sklearn.preprocessing import QuantileTransformer
257257
>>> from sklearn.linear_model import LinearRegression
258258
>>> from sklearn.model_selection import train_test_split
259-
>>> X, y = load_boston(return_X_y=True)
259+
>>> X, y = fetch_california_housing(return_X_y=True)
260+
>>> X, y = X[:2000, :], y[:2000] # select a subset of data
260261
>>> transformer = QuantileTransformer(output_distribution='normal')
261262
>>> regressor = LinearRegression()
262263
>>> regr = TransformedTargetRegressor(regressor=regressor,
@@ -265,10 +266,10 @@ be applied to the target variable::
265266
>>> regr.fit(X_train, y_train)
266267
TransformedTargetRegressor(...)
267268
>>> print('R2 score: {0:.2f}'.format(regr.score(X_test, y_test)))
268-
R2 score: 0.67
269+
R2 score: 0.61
269270
>>> raw_target_regr = LinearRegression().fit(X_train, y_train)
270271
>>> print('R2 score: {0:.2f}'.format(raw_target_regr.score(X_test, y_test)))
271-
R2 score: 0.64
272+
R2 score: 0.59
272273

273274
For simple transformations, instead of a Transformer object, a pair of
274275
functions can be passed, defining the transformation and its inverse mapping::
@@ -286,7 +287,7 @@ Subsequently, the object is created as::
286287
>>> regr.fit(X_train, y_train)
287288
TransformedTargetRegressor(...)
288289
>>> print('R2 score: {0:.2f}'.format(regr.score(X_test, y_test)))
289-
R2 score: 0.65
290+
R2 score: 0.51
290291

291292
By default, the provided functions are checked at each fit to be the inverse of
292293
each other. However, it is possible to bypass this checking by setting
@@ -301,7 +302,7 @@ each other. However, it is possible to bypass this checking by setting
301302
>>> regr.fit(X_train, y_train)
302303
TransformedTargetRegressor(...)
303304
>>> print('R2 score: {0:.2f}'.format(regr.score(X_test, y_test)))
304-
R2 score: -4.50
305+
R2 score: -1.57
305306

306307
.. note::
307308

doc/modules/cross_validation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ Example of 3-split time series cross-validation on a dataset with 6 samples::
782782
>>> y = np.array([1, 2, 3, 4, 5, 6])
783783
>>> tscv = TimeSeriesSplit(n_splits=3)
784784
>>> print(tscv)
785-
TimeSeriesSplit(max_train_size=None, n_splits=3)
785+
TimeSeriesSplit(gap=0, max_train_size=None, n_splits=3, test_size=None)
786786
>>> for train, test in tscv.split(X):
787787
... print("%s %s" % (train, test))
788788
[0 1 2] [3]

0 commit comments

Comments
 (0)
0