-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '197c0cbfd529fd617c3c4e893ea8e3cd0d2493a0' into main
- Loading branch information
Showing
3 changed files
with
94 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from pathlib import Path | ||
import requests | ||
from zipfile import ZipFile | ||
|
||
ML_LOC = "http://files.grouplens.org/datasets/movielens/" | ||
ML_DATASETS = { | ||
'ml-100k': 'ml-100k/u.data', | ||
'ml-1m': 'ml-1m/ratings.dat', | ||
'ml-10m': 'ml-10M100K/ratings.dat', | ||
'ml-20m': 'ml-20m/ratings.csv', | ||
'ml-25m': 'ml-25m/ratings.csv', | ||
} | ||
|
||
|
||
def fetch_ml(dir: Path, ds: str): | ||
zipname = f'{ds}.zip' | ||
zipfile = dir / zipname | ||
zipurl = ML_LOC + zipname | ||
|
||
test_file = dir / ML_DATASETS[ds] | ||
if test_file.exists(): | ||
print(test_file, 'already exists') | ||
return | ||
|
||
print('downloading data set', ds) | ||
with zipfile.open('wb') as zf: | ||
res = requests.get(zipurl, stream=True) | ||
for block in res.iter_content(None): | ||
zf.write(block) | ||
|
||
print('unpacking data set') | ||
with ZipFile(zipfile, 'r') as zf: | ||
zf.extractall(dir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# environment mini-spec for ensuring MKL | ||
dependencies: | ||
- libblas=*=*mkl | ||
- mkl=2020 | ||
- tbb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters