Skip to content

Commit cdebc18

Browse files
committed
FIX don't put data in source dir in bench_covtype
When running under a tool such as @fabianp's profiler yep, dirname(__file__) is the location of the tool's __main__.py instead of the benchmarks directory. Also, we shipped a tarball containing a large dataset before.
1 parent bc6ad64 commit cdebc18

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

benchmarks/bench_covertype.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
import numpy as np
5757

58-
from sklearn.datasets import fetch_covtype
58+
from sklearn.datasets import fetch_covtype, get_data_home
5959
from sklearn.svm import LinearSVC
6060
from sklearn.linear_model import SGDClassifier
6161
from sklearn.naive_bayes import GaussianNB
@@ -96,9 +96,7 @@
9696

9797
# Memoize the data extraction and memory map the resulting
9898
# train / test splits in readonly mode
99-
bench_folder = os.path.dirname(__file__)
100-
original_archive = os.path.join(bench_folder, 'covtype.data.gz')
101-
joblib_cache_folder = os.path.join(bench_folder, 'bench_covertype_data')
99+
joblib_cache_folder = os.path.join(get_data_home(), 'covertype_benchmark_data')
102100
m = Memory(joblib_cache_folder, mmap_mode='r')
103101

104102

0 commit comments

Comments
 (0)