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

[MRG+1] remove __future__ imports #12791

Merged
merged 15 commits into from
Feb 2, 2019
1 change: 0 additions & 1 deletion benchmarks/bench_20newsgroups.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function, division
from time import time
import argparse
import numpy as np
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_covertype.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
[1] https://archive.ics.uci.edu/ml/datasets/Covertype

"""
from __future__ import division, print_function

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary whiteline?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Man !

# Author: Peter Prettenhofer <[email protected]>
# Arnaud Joly <[email protected]>
Expand Down
2 changes: 0 additions & 2 deletions benchmarks/bench_isotonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
This allows the scaling of the algorithm with the problem size to be
visualized and understood.
"""
from __future__ import print_function

import numpy as np
import gc
from datetime import datetime
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
CART 20.69s 0.02s 0.1219
dummy 0.00s 0.01s 0.8973
"""
from __future__ import division, print_function

# Author: Issam H. Laradji
# Arnaud Joly <[email protected]>
Expand Down
2 changes: 0 additions & 2 deletions benchmarks/bench_multilabel_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"""
A comparison of multilabel target formats and metrics over them
"""
from __future__ import division
from __future__ import print_function

from timeit import timeit
from functools import partial
Expand Down
2 changes: 0 additions & 2 deletions benchmarks/bench_plot_fastkmeans.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

from collections import defaultdict
from time import time

Expand Down
2 changes: 0 additions & 2 deletions benchmarks/bench_plot_lasso_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function

from collections import defaultdict
import gc
import sys
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_plot_nmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Anthony Di Franco (projected gradient, Python and NumPy port)
# License: BSD 3 clause

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary whiteline?

from __future__ import print_function
from time import time
import sys
import warnings
Expand Down
2 changes: 0 additions & 2 deletions benchmarks/bench_plot_omp_lars.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function

import gc
import sys
from time import time
Expand Down
3 changes: 0 additions & 3 deletions benchmarks/bench_random_projections.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
Benchmarks for random projections.

"""
from __future__ import division
from __future__ import print_function

import gc
import sys
import optparse
Expand Down
3 changes: 0 additions & 3 deletions benchmarks/bench_sample_without_replacement.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
Benchmarks for sampling without replacement of integer.

"""
from __future__ import division
from __future__ import print_function

import gc
import sys
import optparse
Expand Down
3 changes: 0 additions & 3 deletions benchmarks/bench_text_vectorizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
* psutil (optional, but recommended)

"""

from __future__ import print_function

import timeit
import itertools

Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_tsne_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
=============================

"""
from __future__ import division, print_function

# License: BSD 3 clause

Expand Down
2 changes: 0 additions & 2 deletions build_tools/circle/list_versions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python3

# List all available versions of the documentation
from __future__ import print_function

import json
import re
import sys
Expand Down
2 changes: 0 additions & 2 deletions build_tools/generate_authors_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
The table should be updated for each new inclusion in the teams.
Generating the table requires admin rights.
"""
from __future__ import print_function

import sys
import requests
import getpass
Expand Down
1 change: 0 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary whiteline?

from __future__ import print_function
import sys
import os
import warnings
Expand Down
1 change: 0 additions & 1 deletion doc/modules/compose.rst
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ variable::
For simple transformations, instead of a Transformer object, a pair of
functions can be passed, defining the transformation and its inverse mapping::

>>> from __future__ import division
>>> def func(x):
... return np.log(x)
>>> def inverse_func(x):
Expand Down
1 change: 0 additions & 1 deletion doc/tutorial/machine_learning_map/parse_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
Based on: https://wxpsvg.googlecode.com/svn/trunk/svg/pathdata.py
According to that project, this file is licensed under the LGPL
"""
from __future__ import print_function

try:
from pyparsing import (ParserElement, Literal, Word, CaselessLiteral,
Expand Down
3 changes: 0 additions & 3 deletions doc/tutorial/machine_learning_map/svg2imagemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
group1 through groupN are group ids. If only want particular groups used,
enter their ids here and all others will be ignored.
"""

from __future__ import print_function

import os
import re
import sys
Expand Down
1 change: 0 additions & 1 deletion doc/tutorial/statistical_inference/supervised_learning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ This is an example of **bias/variance tradeoff**: the larger the ridge
We can choose ``alpha`` to minimize left out error, this time using the
diabetes dataset rather than our synthetic data::

>>> from __future__ import print_function
>>> alphas = np.logspace(-4, -1, 6)
>>> print([regr.set_params(alpha=alpha)
... .fit(diabetes_X_train, diabetes_y_train)
Expand Down
2 changes: 0 additions & 2 deletions examples/applications/plot_face_recognition.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
================== ============ ======= ========== =======

"""
from __future__ import print_function

from time import time
import logging
import matplotlib.pyplot as plt
Expand Down
1 change: 0 additions & 1 deletion examples/applications/plot_out_of_core_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
# @FedericoV <https://github.com/FedericoV/>
# License: BSD 3 clause

from __future__ import print_function
from glob import glob
import itertools
import os.path
Expand Down
1 change: 0 additions & 1 deletion examples/applications/plot_prediction_latency.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Authors: Eustache Diemert <[email protected]>
# License: BSD 3 clause

from __future__ import print_function
from collections import defaultdict

import time
Expand Down
2 changes: 0 additions & 2 deletions examples/applications/plot_species_distribution_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
#
# License: BSD 3 clause

from __future__ import print_function

from time import time

import numpy as np
Expand Down
1 change: 0 additions & 1 deletion examples/applications/plot_stock_market.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
heuristic based on the direction of the nearest neighbor along each
axis.
"""
from __future__ import print_function

# Author: Gael Varoquaux [email protected]
# License: BSD 3 clause
Expand Down
1 change: 0 additions & 1 deletion examples/applications/plot_tomography_l1_reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class :class:`sklearn.linear_model.Lasso`, that uses the coordinate descent
the circular artifact separating the pixels in the corners, that have
contributed to fewer projections than the central disk.
"""
from __future__ import division

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary whiteline?

print(__doc__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# Chyi-Kwei Yau <[email protected]>
# License: BSD 3 clause

from __future__ import print_function
from time import time

from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
Expand Down
2 changes: 0 additions & 2 deletions examples/applications/wikipedia_principal_eigenvector.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
# Author: Olivier Grisel <[email protected]>
# License: BSD 3 clause

from __future__ import print_function

from bz2 import BZ2File
import os
from datetime import datetime
Expand Down
2 changes: 0 additions & 2 deletions examples/bicluster/plot_bicluster_newsgroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
achieve a better V-measure than clusters found by MiniBatchKMeans.

"""
from __future__ import print_function

from collections import defaultdict
import operator
from time import time
Expand Down
3 changes: 0 additions & 3 deletions examples/classification/plot_lda.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

Shows how shrinkage improves classification.
"""

from __future__ import division

import numpy as np
import matplotlib.pyplot as plt

Expand Down
3 changes: 0 additions & 3 deletions examples/cluster/plot_kmeans_silhouette_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
or less of similar thickness and hence are of similar sizes as can be also
verified from the labelled scatter plot on the right.
"""

from __future__ import print_function

from sklearn.datasets import make_blobs
from sklearn.cluster import KMeans
from sklearn.metrics import silhouette_samples, silhouette_score
Expand Down
1 change: 0 additions & 1 deletion examples/compose/plot_column_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# Author: Matt Terry <[email protected]>
#
# License: BSD 3 clause
from __future__ import print_function

import numpy as np

Expand Down
2 changes: 0 additions & 2 deletions examples/compose/plot_column_transformer_mixed_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#
# License: BSD 3 clause

from __future__ import print_function

import pandas as pd
import numpy as np

Expand Down
1 change: 0 additions & 1 deletion examples/compose/plot_compare_reduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

# Authors: Robert McGibbon, Joel Nothman, Guillaume Lemaitre

from __future__ import print_function, division

import numpy as np
import matplotlib.pyplot as plt
Expand Down
1 change: 0 additions & 1 deletion examples/compose/plot_feature_union.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#
# License: BSD 3 clause

from __future__ import print_function
from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.model_selection import GridSearchCV
from sklearn.svm import SVC
Expand Down
1 change: 0 additions & 1 deletion examples/compose/plot_transformed_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# Author: Guillaume Lemaitre <[email protected]>
# License: BSD 3 clause

from __future__ import print_function, division

import numpy as np
import matplotlib
Expand Down
1 change: 0 additions & 1 deletion examples/datasets/plot_random_multilabel_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
feature distinguishes a particular class.
"""

from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt

Expand Down
1 change: 0 additions & 1 deletion examples/ensemble/plot_partial_dependence.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
.. [2] For classification you can think of it as the regression score before
the link function.
"""
from __future__ import print_function
print(__doc__)

import numpy as np
Expand Down
1 change: 0 additions & 1 deletion examples/exercises/plot_cv_diabetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
:ref:`model_selection_tut` section of the :ref:`stat_learn_tut_index`.
"""

from __future__ import print_function
print(__doc__)

import numpy as np
Expand Down
1 change: 0 additions & 1 deletion examples/gaussian_process/plot_gpr_co2.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
#
# License: BSD 3 clause

from __future__ import division, print_function

import numpy as np

Expand Down
1 change: 0 additions & 1 deletion examples/linear_model/plot_sgd_early_stopping.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
# Authors: Tom Dupre la Tour
#
# License: BSD 3 clause
from __future__ import print_function
import time
import sys

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
# Peter Prettenhofer <[email protected]>
# Mathieu Blondel <[email protected]>
# License: BSD 3 clause

from __future__ import print_function

from pprint import pprint
from time import time
import logging
Expand Down
3 changes: 0 additions & 3 deletions examples/model_selection/plot_grid_search_digits.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
sections on :ref:`cross_validation` and :ref:`grid_search`.

"""

from __future__ import print_function

from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV
Expand Down
2 changes: 0 additions & 2 deletions examples/model_selection/plot_precision_recall.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@
:func:`sklearn.metrics.precision_score`,
:func:`sklearn.metrics.f1_score`
"""
from __future__ import print_function

###############################################################################
# In binary classification settings
# --------------------------------------------------------
Expand Down
3 changes: 0 additions & 3 deletions examples/neural_networks/plot_rbm_logistic_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
example shows that the features extracted by the BernoulliRBM help improve the
classification accuracy.
"""

from __future__ import print_function

print(__doc__)

# Authors: Yann N. Dauphin, Vlad Niculae, Gabriel Synnaeve
Expand Down
1 change: 0 additions & 1 deletion examples/plot_kernel_ridge_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
# License: BSD 3 clause


from __future__ import division
import time

import numpy as np
Expand Down
Loading