Fix train/test split
This commit is contained in:
parent
af56ec3fec
commit
edeac12e37
7 changed files with 9738 additions and 26131 deletions
14
src/data.py
Normal file
14
src/data.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import random
|
||||
from config import DATA, TRAIN_SIZE
|
||||
|
||||
random.seed(42)
|
||||
length = len(DATA)
|
||||
indices = list(range(length))
|
||||
|
||||
random.shuffle(indices)
|
||||
|
||||
train_indices = indices[: int(length * TRAIN_SIZE)]
|
||||
test_indices = indices[int(length * TRAIN_SIZE) :]
|
||||
|
||||
TRAIN_DATA = [DATA[i] for i in train_indices]
|
||||
TEST_DATA = [DATA[i] for i in test_indices]
|
||||
Loading…
Add table
Add a link
Reference in a new issue