8000 Merge branch 'master' into ordinal_enc_handle_missing · scikit-learn/scikit-learn@5a4dee8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5a4dee8

Browse files
authored
Merge branch 'master' into ordinal_enc_handle_missing
2 parents f35c5c0 + 1c88b3c commit 5a4dee8

File tree

299 files changed

+4565
-5069
lines changed

Some content is hidden

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

299 files changed

+4565
-5069
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ matrix:
6262
if: type = cron OR commit_message =~ /\[scipy-dev\]/
6363

6464
install: source build_tools/travis/install.sh
65-
script: bash build_tools/travis/test_script.sh
65+
script:
66+
- bash build_tools/travis/test_script.sh
67+
- bash build_tools/travis/test_docs.sh
68+
- bash build_tools/travis/test_pytest_soft_dependency.sh
6669
after_success: source build_tools/travis/after_success.sh
6770
notifications:
6871
webhooks:

CONTRIBUTING.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,25 @@ following rules before submitting:
178178
as your Python, scikit-learn, numpy, and scipy versions. This information
179179
can be found by running the following code snippet:
180180

181-
```python
182-
import platform; print(platform.platform())
183-
import sys; print("Python", sys.version)
184-
import numpy; print("NumPy", numpy.__version__)
185-
import scipy; print("SciPy", scipy.__version__)
186-
import sklearn; print("Scikit-Learn", sklearn.__version__)
187-
```
181+
For scikit-learn >= 0.20:
182+
183+
```python
184+
import sklearn; sklearn.show_versions()
185+
```
186+
187+
For scikit-learn < 0.20:
188+
189+
```python
190+
import platform; print(platform.platform())
191+
import sys; print("Python", sys.version)
192+
import numpy; print("NumPy", numpy.__version__)
193+
import scipy; print("SciPy", scipy.__version__)
194+
import sklearn; print("Scikit-Learn", sklearn.__version__)
195+
```
188196

189197
- Please be specific about what estimators and/or functions are involved
190198
and the shape of the data, as appropriate; please include a
191-
[reproducible](http://stackoverflow.com/help/mcve) code snippet
199+
[reproducible](https://stackoverflow.com/help/mcve) code snippet
192200
or link to a [gist](https://gist.github.com). If an exception is raised,
193201
please provide the traceback.
194202

@@ -222,8 +230,8 @@ be placed in ``_build/html/stable`` and are viewable in a web browser. See the
222230

223231
For building the documentation, you will need
224232
[sphinx](http://sphinx.pocoo.org/),
225-
[matplotlib](http://matplotlib.org/), and
226-
[pillow](http://pillow.readthedocs.io/en/latest/).
233+
[matplotlib](https://matplotlib.org/), and
234+
[pillow](https://pillow.readthedocs.io/en/latest/).
227235

228236
When you are writing documentation, it is important to keep a good
229237
compromise between mathematical and algorithmic details, and give

ISSUE_TEMPLATE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
If your issue is a usage question, submit it here instead:
3-
- StackOverflow with the scikit-learn tag: http://stackoverflow.com/questions/tagged/scikit-learn
3+
- StackOverflow with the scikit-learn tag: https://stackoverflow.com/questions/tagged/scikit-learn
44
- Mailing List: https://mail.python.org/mailman/listinfo/scikit-learn
55
For more information, see User Questions: http://scikit-learn.org/stable/support.html#user-questions
66
-->
@@ -43,6 +43,9 @@ it in the issue: https://gist.github.com
4343
#### Versions
4444
<!--
4545
Please run the following snippet and paste the output below.
46+
For scikit-learn >= 0.20:
47+
import sklearn; sklearn.show_versions()
48+
For scikit-learn < 0.20:
4649
import platform; print(platform.platform())
4750
import sys; print("Python", sys.version)
4851
import numpy; print("NumPy", numpy.__version__)

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ recursive-include examples *
44
recursive-include sklearn *.c *.h *.pyx *.pxd *.pxi
55
recursive-include sklearn/datasets *.csv *.csv.gz *.rst *.jpg *.txt *.arff.gz *.json.gz
66
include COPYING
7-
include AUTHORS.rst
87
include README.rst
98

README.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ SciPy and distributed under the 3-Clause BSD license.
3434

3535
The project was started in 2007 by David Cournapeau as a Google Summer
3636
of Code project, and since then many volunteers have contributed. See
37-
the `AUTHORS.rst <AUTHORS.rst>`_ file for a complete list of contributors.
37+
the `About us <http://scikit-learn.org/dev/about.html#authors>`_ page
38+
for a list of core contributors.
3839

3940
It is currently maintained by a team of volunteers.
4041

@@ -63,7 +64,7 @@ scikit-learn also uses CBLAS, the C interface to the Basic Linear Algebra
6364
Subprograms library. scikit-learn comes with a reference implementation, but
6465
the system CBLAS will be detected by the build system and used if present.
6566
CBLAS exists in many implementations; see `Linear algebra libraries
66-
<http://scikit-learn.org/stable/modules/computational_performance.html#linear-algebra-libraries>`_
67+
<http://scikit-learn.org/stable/modules/computing#linear-algebra-libraries>`_
6768
for known issues.
6869

6970
User installation
@@ -100,7 +101,7 @@ Important links
100101
~~~~~~~~~~~~~~~
101102

102103
- Official source code repo: https://github.com/scikit-learn/scikit-learn
103-
- Download releases: https://pypi.python.org/pypi/scikit-learn
104+
- Download releases: https://pypi.org/project/scikit-learn/
104105
- Issue tracker: https://github.com/scikit-learn/scikit-learn/issues
105106

106107
Source code
@@ -143,7 +144,8 @@ Project History
143144

144145
The project was started in 2007 by David Cournapeau as a Google Summer
145146
of Code project, and since then many volunteers have contributed. See
146-
the `AUTHORS.rst <AUTHORS.rst>`_ file for a complete list of contributors.
147+
the `About us <http://scikit-learn.org/dev/about.html#authors>`_ page
148+
for a list of core contributors.
147149

148150
The project is currently maintained by a team of volunteers.
149151

@@ -165,7 +167,7 @@ Communication
165167

166168
- Mailing list: https://mail.python.org/mailman/listinfo/scikit-learn
167169
- IRC channel: ``#scikit-learn`` at ``webchat.freenode.net``
168-
- Stack Overflow: http://stackoverflow.com/questions/tagged/scikit-learn
170+
- Stack Overflow: https://stackoverflow.com/questions/tagged/scikit-learn
169171
- Website: http://scikit-learn.org
170172

171173
Citation

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ environment:
66
global:
77
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
88
# /E:ON and /V:ON options are not enabled in the batch script interpreter
9-
# See: http://stackoverflow.com/a/13751649/163740
9+
# See: https://stackoverflow.com/a/13751649/163740
1010
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\build_tools\\appveyor\\run_with_env.cmd"
1111
WHEELHOUSE_UPLOADER_USERNAME: sklearn-appveyor
1212
WHEELHOUSE_UPLOADER_SECRET:
@@ -46,7 +46,7 @@ install:
4646
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
4747
throw "There are newer queued builds for this pull request, failing early." }
4848

49-
# Install Python (from the official .msi of http://python.org) and pip when
49+
# Install Python (from the official .msi of https://python.org) and pip when
5050
# not already installed.
5151
- "powershell ./build_tools/appveyor/install.ps1"
5252
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"

benchmarks/bench_covertype.py

< 10000 span class="prc-TooltipV2-Tooltip-cYMVY" data-direction="s" role="tooltip" aria-hidden="true" id=":R4djtlab:">Expand all lines: benchmarks/bench_covertype.py
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
S. Shalev-Shwartz, Y. Singer, N. Srebro - In Proceedings of ICML '07.
3535
3636
* `"Training Linear SVMs in Linear Time"
37-
<www.cs.cornell.edu/People/tj/publications/joachims_06a.pdf>`_
37+
<https://www.cs.cornell.edu/people/tj/publications/joachims_06a.pdf>`_
3838
T. Joachims - In SIGKDD '06
3939
40-
[1] http://archive.ics.uci.edu/ml/datasets/Covertype
40+
[1] https://archive.ics.uci.edu/ml/datasets/Covertype
4141
4242
"""
4343
from __future__ import division, print_function
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import matplotlib.pyplot as plt
2+
import numpy as np
3+
import scipy.sparse as sparse
4+
from sklearn.preprocessing import PolynomialFeatures
5+
from time import time
6+
7+
degree = 2
8+
trials = 3
9+
num_rows = 1000
10+
dimensionalities = np.array([1, 2, 8, 16, 32, 64])
11+
densities = np.array([0.01, 0.1, 1.0])
12+
csr_times = {d: np.zeros(len(dimensionalities)) for d in densities}
13+
dense_times = {d: np.zeros(len(dimensionalities)) for d in densities}
14+
transform = PolynomialFeatures(degree=degree, include_bias=False,
15+
interaction_only=False)
16+
17+
for trial in range(trials):
18+
for density in densities:
19+
for dim_index, dim in enumerate(dimensionalities):
20+
print(trial, density, dim)
21+
X_csr = sparse.random(num_rows, dim, density).tocsr()
22+
X_dense = X_csr.toarray()
23+
# CSR
24+
t0 = time()
25+
transform.fit_transform(X_csr)
26+
csr_times[density][dim_index] += time() - t0
27+
# Dense
28+
t0 = time()
29+
transform.fit_transform(X_dense)
30+
dense_times[density][dim_index] += time() - t0
31+
32+
csr_linestyle = (0, (3, 1, 1, 1, 1, 1)) # densely dashdotdotted
33+
dense_linestyle = (0, ()) # solid
34+
35+
fig, axes = plt.subplots(nrows=len(densities), ncols=1, figsize=(8, 10))
36+
for density, ax in zip(densities, axes):
37+
38+
ax.plot(dimensionalities, csr_times[density] / trials,
39+
label='csr', linestyle=csr_linestyle)
40+
ax.plot(dimensionalities, dense_times[density] / trials,
41+
label='dense', linestyle=dense_linestyle)
42+
ax.set_title("density %0.2f, degree=%d, n_samples=%d" %
43+
(density, degree, num_rows))
44+
ax.legend()
45+
ax.set_xlabel('Dimensionality')
46+
ax.set_ylabel('Time (seconds)')
47+
48+
plt.tight_layout()
49+
plt.show()

benchmarks/bench_plot_nmf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def _nls_subproblem(X, W, H, tol, max_iter, alpha=0., l1_ratio=0.,
9696
----------
9797
C.-J. Lin. Projected gradient methods for non-negative matrix
9898
factorization. Neural Computation, 19(2007), 2756-2779.
99-
http://www.csie.ntu.edu.tw/~cjlin/nmf/
99+
https://www.csie.ntu.edu.tw/~cjlin/nmf/
100100
"""
101101
WtX = safe_sparse_dot(W.T, X)
102102
WtW = np.dot(W.T, W)

benchmarks/bench_plot_randomized_svd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
----------
5353
(1) Finding structure with randomness: Stochastic algorithms for constructing
5454
approximate matrix decompositions
55-
Halko, et al., 2009 http://arxiv.org/abs/arXiv:0909.4061
55+
Halko, et al., 2009 https://arxiv.org/abs/0909.4061
5656
5757
(2) A randomized algorithm for the decomposition of matrices
5858
Per-Gunnar Martinsson, Vladimir Rokhlin and Mark Tygert
@@ -106,7 +106,7 @@
106106
MAX_MEMORY = np.int(2e9)
107107

108108
# The following datasets can be dowloaded manually from:
109-
# CIFAR 10: http://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz
109+
# CIFAR 10: https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz
110110
# SVHN: http://ufldl.stanford.edu/housenumbers/train_32x32.mat
111111
CIFAR_FOLDER = "./cifar-10-batches-py/"
112112
SVHN_FOLDER = "./SVHN/"

0 commit comments

Comments
 (0)
0