Ive been working on the first week assignment and, once i submit i get 0 points and an error saying:
There was a problem compiling the code from your notebook, please check that you saved before submitting. Details:
name ‘time_valid’ is not defined

‘time_valid’ is assigned through the first graded function call and of course i saved the file, i have passed all tests except the last one, im in a hurry as i wanted to conclude the cert before the subscription renewal and so i submitted anyways, knowing i would pass the assignment; but now im stuck as i keep getting 0/80.
Ive already tried refreshing/updating the notebook and rewriting my solutions on it, but the issue persists.
Any help is appreciated, thanks!

Also never be in hurry to get certificate, focus should be on learning. You can contact Coursera Learner Help center if you want a week extension on your subscription with your reason of delay. They might or might not extend (this is only if you have paid subscription and not financial aid subscription)

Please make sure not to post any codes here as it’s against community guidelines.

Hello, thank you for the answer, but the error doesnt seem to be related to the functions. I have also disconnected and reconnected the kernel and reran the code before submitting, but i still got 0.
Anyways, may i send you the last function code? I cant figure out what im getting wrong, thanks.

When you do now correction please make sure to get a fresh copy of assignment and only write codes between assigned markers ###START AND END CODE HERE### and making sure not to delete the already given instructions and do not add your own way of writing the codes.

You suppose to only replace None placed between the Markers ###START AND END CODE HERE### without editing the already given instructions or part of codes already given to you when you first open the assignment notebook. By following this, your are preventing any grade failure as per autograder.

Now comes to your code as per each grade cell.

Your train_val_split codes are correct.

Your compute metrics codes are correct.

Your error in codes starts from naive forecast where you seems to have done editing and hard-coded the path. According to the instructions given, you are suppose to use the whole SERIES (training and validation) and the SPLIT_TIME to compute naive forecast. So this code is in single line where you use the SERIES and apply to [SPLIT_TIME - 1:-1]

Next in moving average forecast, your range code is incorrect. You are suppose to use len function to arg (series) - window_size.
Then when you forecast.append to (series[time:time + window_size].mean())

In diff series calculation, you have again hard coded the path. Instructions given is
Since the seasonality period is 365 days, we will subtract the value at time t – 365 from the value at time t.
Define the diff_series and diff_time variables below to achieve this. Notice that diff_time is the values of the x-coordinate for diff_series.
So diff series would be (SERIES[365:] - SERIES[:-365]) and diff time would be TIME[365:]

for diff moving avg, your code are incorrect for
Perform the correct slicing where you used len function to the series and split but you had to use [SPLIT_TIME - 365 - WINDOW_SIZE:] to the diff moving avg.

For past series, the code is same way I mentioned for naive forecast but the value here would 365 instead of 1 as we are calculating the seasonality from previous cycle in the original time series.

Smooth past series codes I didn’t see but just a heads for you to debug yourself, please don’t use any len function here . Just use the SERIES AND SPLIT TIME CORRECTLY WITH WINDOW_SIZE of 11, so SPLIT TIME would be subtracted from 370:-359 as WINDOW SIZE is 11.

I hope you know how to get a fresh copy of assignment, in case you don’t let me know.