diff --git a/.binder/requirements.txt b/.binder/requirements.txt index 9ecc5c6fba79c..1e46398a5b7b0 100644 --- a/.binder/requirements.txt +++ b/.binder/requirements.txt @@ -1,8 +1,5 @@ ---extra-index https://pypi.anaconda.org/scipy-wheels-nightly/simple scikit-learn ---pre matplotlib scikit-image pandas sphinx-gallery -scikit-learn - +scikit-learn>=0.23,<0.24 diff --git a/build_tools/azure/test_script.cmd b/build_tools/azure/test_script.cmd index f1e516d81fd99..2078692b5dc23 100644 --- a/build_tools/azure/test_script.cmd +++ b/build_tools/azure/test_script.cmd @@ -10,7 +10,8 @@ mkdir %TMP_FOLDER% cd %TMP_FOLDER% if "%CHECK_WARNINGS%" == "true" ( - set PYTEST_ARGS=%PYTEST_ARGS% -Werror::DeprecationWarning -Werror::FutureWarning + REM numpy's 1.19.0's tostring() deprecation is ignored until scipy and joblib removes its usage + set PYTEST_ARGS=%PYTEST_ARGS% -Werror::DeprecationWarning -Werror::FutureWarning -Wignore:tostring:DeprecationWarning ) if "%COVERAGE%" == "true" ( diff --git a/build_tools/azure/test_script.sh b/build_tools/azure/test_script.sh index 77a950d86549c..adef606df1d94 100755 --- a/build_tools/azure/test_script.sh +++ b/build_tools/azure/test_script.sh @@ -29,7 +29,8 @@ if [[ "$COVERAGE" == "true" ]]; then fi if [[ -n "$CHECK_WARNINGS" ]]; then - TEST_CMD="$TEST_CMD -Werror::DeprecationWarning -Werror::FutureWarning" + # numpy's 1.19.0's tostring() deprecation is ignored until scipy and joblib removes its usage + TEST_CMD="$TEST_CMD -Werror::DeprecationWarning -Werror::FutureWarning -Wignore:tostring:DeprecationWarning" fi if [[ "$PYTHON_VERSION" == "*" ]]; then diff --git a/conftest.py b/conftest.py index 874931341e195..f52ee5f19634d 100644 --- a/conftest.py +++ b/conftest.py @@ -7,7 +7,6 @@ import platform import sys -from distutils.version import LooseVersion import os import pytest @@ -17,10 +16,11 @@ from sklearn.utils import _IS_32BIT from sklearn.externals import _pilutil from sklearn._build_utils.deprecated_modules import _DEPRECATED_MODULES +from sklearn.utils.fixes import np_version, parse_version PYTEST_MIN_VERSION = '3.3.0' -if LooseVersion(pytest.__version__) < PYTEST_MIN_VERSION: +if parse_version(pytest.__version__) < parse_version(PYTEST_MIN_VERSION): raise ImportError('Your version of pytest is too old, you should have ' 'at least pytest >= {} installed.' .format(PYTEST_MIN_VERSION)) @@ -54,8 +54,7 @@ def pytest_collection_modifyitems(config, items): # run doctests only for numpy >= 1.14. skip_doctests = False try: - import numpy as np - if LooseVersion(np.__version__) < LooseVersion('1.14'): + if np_version < parse_version('1.14'): reason = 'doctests are only run for numpy >= 1.14' skip_doctests = True elif _IS_32BIT: diff --git a/doc/conf.py b/doc/conf.py index 74e37d01307be..539229a605330 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -80,7 +80,7 @@ # General information about the project. project = 'scikit-learn' -copyright = '2007 - 2019, scikit-learn developers (BSD License)' +copyright = '2007 - 2020, scikit-learn developers (BSD License)' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/doc/modules/linear_model.rst b/doc/modules/linear_model.rst index 477baca9c4de3..c4767d0cb2d64 100644 --- a/doc/modules/linear_model.rst +++ b/doc/modules/linear_model.rst @@ -997,8 +997,8 @@ Examples of use cases include: * Risk modeling / insurance policy pricing: number of claim events / policyholder per year (Poisson), cost per event (Gamma), total cost per policyholder per year (Tweedie / Compound Poisson Gamma). -* Predictive maintenance: number of production interruption events per year: - Poisson, duration of interruption: Gamma, total interruption time per year +* Predictive maintenance: number of production interruption events per year + (Poisson), duration of interruption (Gamma), total interruption time per year (Tweedie / Compound Poisson Gamma). diff --git a/doc/modules/model_persistence.rst b/doc/modules/model_persistence.rst index 81b3dfce63b99..3c59b7a313a17 100644 --- a/doc/modules/model_persistence.rst +++ b/doc/modules/model_persistence.rst @@ -20,7 +20,7 @@ Persistence example ------------------- It is possible to save a model in scikit-learn by using Python's built-in -persistence model, namely `pickle `_:: +persistence model, namely `pickle `_:: >>> from sklearn import svm >>> from sklearn import datasets diff --git a/doc/templates/index.html b/doc/templates/index.html index f49fbc2f4c540..58ba61a2c0ca3 100644 --- a/doc/templates/index.html +++ b/doc/templates/index.html @@ -155,6 +155,10 @@

News