add create-dataset python file
This commit is contained in:
parent
8eb731b53f
commit
1afa0cf50e
17
create-dataset.py
Normal file
17
create-dataset.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import pandas as pd
|
||||||
|
import os
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
|
cutoff = int(os.environ['CUTOFF'])
|
||||||
|
|
||||||
|
data = pd.read_csv('./ium_z444510/barcelona_weekends.csv')
|
||||||
|
data = data.sample(cutoff)
|
||||||
|
data = data.iloc[:, 1:]
|
||||||
|
|
||||||
|
train_set, dev_set, test_set = np.split(data.sample(frac=1, random_state=42),
|
||||||
|
[int(.6 * len(data)), int(.8 * len(data))])
|
||||||
|
|
||||||
|
train_set.to_csv('train.csv', index=False)
|
||||||
|
dev_set.to_csv('dev.csv', index=False)
|
||||||
|
test_set.to_csv('test.csv', index=False)
|
Loading…
Reference in New Issue
Block a user