8000 Merge remote-tracking branch 'upstream/master' into labelencoder-sets · scikit-learn/scikit-learn@e34e297 · GitHub
[go: up one dir, main page]

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 e34e297

Browse files
Merge remote-tracking branch 'upstream/master' into labelencoder-sets
2 parents 662da67 + a320c08 commit e34e297

File tree

100 files changed

+2214
-11043
lines changed

Some content is hidden

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

100 files changed

+2214
-11043
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ benchmarks/bench_covertype_data/
5454
*.prefs
5555
.pydevproject
5656
.idea
57+
.vscode
5758

5859
*.c
5960
*.cpp

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ matrix:
5656
# installed from their CI wheels in a virtualenv with the Python
5757
# interpreter provided by travis.
5858
- python: 3.6
59-
env: DISTRIB="scipy-dev-wheels"
60-
if: type = cron
59+
env: DISTRIB="scipy-dev"
60+
if: type = cron OR commit_message ~ /\[scipy-dev\]/
6161

6262
install: source build_tools/travis/install.sh
6363
script: bash build_tools/travis/test_script.sh

benchmarks/bench_plot_incremental_pca.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from collections import defaultdict
1414
import matplotlib.pyplot as plt
1515
from sklearn.datasets import fetch_lfw_people
16-
from sklearn.decomposition import IncrementalPCA, RandomizedPCA, PCA
16+
from sklearn.decomposition import IncrementalPCA, PCA
1717

1818

1919
def plot_results(X, y, label):
@@ -37,7 +37,6 @@ def plot_feature_times(all_times, batch_size, all_components, data):
3737
plot_results(all_components, all_times['pca'], label="PCA")
3838
plot_results(all_components, all_times['ipca'],
3939
label="IncrementalPCA, bsize=%i" % batch_size)
40-
plot_results(all_components, all_times['rpca'], label="RandomizedPCA")
4140
plt.legend(loc="upper left")
4241
plt.suptitle("Algorithm runtime vs. n_components\n \
4342
LFW, size %i x %i" % data.shape)
@@ -50,7 +49,6 @@ def plot_feature_errors(all_errors, batch_size, all_components, data):
5049
plot_results(all_components, all_errors['pca'], label="PCA")
5150
plot_results(all_components, all_errors['ipca'],
5251
label="IncrementalPCA, bsize=%i" % batch_size)
53-
plot_results(all_components, all_errors['rpca'], label="RandomizedPCA")
5452
plt.legend(loc="lower left")
5553
plt.suptitle("Algorithm error vs. n_components\n"
5654
"LFW, size %i x %i" % data.shape)
@@ -61,7 +59,6 @@ def plot_feature_errors(all_errors, batch_size, all_components, data):
6159
def plot_batch_times(all_times, n_features, all_batch_sizes, data):
6260
plt.figure()
6361
plot_results(all_batch_sizes, all_times['pca'], label="PCA")
64-
plot_results(all_batch_sizes, all_times['rpca'], label="RandomizedPCA")
6562
plot_results(all_batch_sizes, all_times['ipca'], label="IncrementalPCA")
6663
plt.legend(loc="lower left")
6764
plt.suptitle("Algorithm runtime vs. batch_size for n_components %i\n \
@@ -92,11 +89,9 @@ def fixed_batch_size_comparison(data):
9289
all_errors = defaultdict(list)
9390
for n_components in all_features:
9491
pca = PCA(n_components=n_components)
95-
rpca = RandomizedPCA(n_components=n_components, random_state=1999)
9692
ipca = IncrementalPCA(n_components=n_components, batch_size=batch_size)
9793
results_dict = {k: benchmark(est, data) for k, est in [('pca', pca),
98-
('ipca', ipca),
99-
('rpca', rpca)]}
94+
('ipca', ipca)]}
10095

10196
for k in sorted(results_dict.keys()):
10297
all_times[k].append(results_dict[k]['time'])
@@ -116,7 +111,8 @@ def variable_batch_size_comparison(data):
116111
all_times = defaultdict(list)
117112
all_errors = defaultdict(list)
118113
pca = PCA(n_components=n_components)
119-
rpca = RandomizedPCA(n_components=n_components, random_state=1999)
114+
rpca = PCA(n_components=n_components, svd_solver='randomized',
115+
random_state=1999)
120116
results_dict = {k: benchmark(est, data) for k, est in [('pca', pca),
121117
('rpca', rpca)]}
122118

@@ -138,8 +134,6 @@ def variable_batch_size_comparison(data):
138134
all_errors['ipca'].append(results_dict['ipca']['error'])
139135

140136
plot_batch_times(all_times, n_components, batch_sizes, data)
141-
# RandomizedPCA error is always worse (approx 100x) than other PCA
142-
# tests
143137
plot_batch_errors(all_errors, n_components, batch_sizes, data)
144138

145139
faces = fetch_lfw_people(resize=.2, min_faces_per_person=5)

build_tools/travis/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ elif [[ "$DISTRIB" == "ubuntu" ]]; then
7878
source testvenv/bin/activate
7979
pip install pytest pytest-cov cython==$CYTHON_VERSION
8080

81-
elif [[ "$DISTRIB" == "scipy-dev-wheels" ]]; then
81+
elif [[ "$DISTRIB" == "scipy-dev" ]]; then
8282
# Set up our own virtualenv environment to avoid travis' numpy.
8383
# This venv points to the python interpreter of the travis build
8484
# matrix.

0 commit comments

Comments
 (0)
0