# Download the dataset. It's small, only about 6 MB.
if not os.path.exists('./ml-1m'):
url = 'http://files.grouplens.org/datasets/movielens/ml-1m.zip'
response = requests.get(url, stream=True)
total_length = response.headers.get('content-length')
bar = tqdm.tqdm_notebook(total=int(total_length))
with open('./ml-1m.zip', 'wb') as f:
for data in response.iter_content(chunk_size=4096):
f.write(data)
bar.update(4096)
zip_ref = zipfile.ZipFile('./ml-1m.zip', 'r')
zip_ref.extractall('.')
zip_ref.close()


+ Recent posts