Testing with a subset of Train Data?

Hello,
I’m new to neural networks and have an issue with Data splitting. Currently my code looks like this:

train, test = D[:round(len(D)*0.8)], D[round(len(D)*0.2):]

Am I testing with a subset of training Data? And if so, how could I fix this?
Thanks for your answer :slight_smile:

Hello! that code takes the first 80% of the data and puts that into train. Then it skips the first 20% and puts the rest into test. Not how we want it. I’d change the code to something like this

split = round(len(D)*0.8) # The index which marks 80% of the data
train = D[:split] # Takes the first 80% of data
test = D[split:] # Takes whatever is left after the first 80% of data -> last 20% of data
1 Like

Thank you very much :slight_smile:
It worked…

1 Like