Assignment 1 - train_val_split

Hi,

This is the code I wrote for the train_val_split function in assignment 1, but I got 0 points. The output of my function is also the same as the expected output. Could you tell me where I’m going wrong?

SPLIT_TIME = 1100

def train_val_split(time, series, time_step=SPLIT_TIME):

### START CODE HERE
time_train = time[:SPLIT_TIME]
series_train = series[:SPLIT_TIME]
time_valid = time[SPLIT_TIME:]
series_valid = series[SPLIT_TIME:]
### END CODE HERE

return time_train, series_train, time_valid, series_valid

Thank you

Hey Prolet!

To be sure, you could send the output of the grader - but to me it looks as though you’re not using the time_step parameter, and are instead using the variable SPLIT_TIME.

Maybe try time_step, and if that doesn’t help - send along the grader output!

Yes, that was it. Thank you very much!

1 Like

Thank you so much! I had the same problem.