hi @edmos7
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 theSPLIT_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.
Regards
DP