C4W1 Assignment last cell expected output

In last cell I found output as mse: 13.59, mae: 2.29 for moving average plus smooth past forecast but expected output is mse: 12.53, mae: 2.20 for moving average plus smooth past forecast.
When I submitted my solution. " diff_moving_avg_plus_smooth_past" function returns different results

Failed test case: diff_moving_avg_plus_smooth_past has incorrect first 5 values.
[59.77063  58.743534 57.702236 56.543404 55.74462 ],
but got:
[58.668976 57.85377  56.53393  55.798813 54.42734 ].

All previous answers give the expected results. I don’t know where did I go wrong?

Please click my name and message your notebook as an attachment.

Please read this topic

@Michael_Crabtree Please see this topic

I’ve read all the topics I can find. I don’t see any help.

  1. how can the same (saved) notebook go from a grade of 79 to zero?
  2. Why does my last mse/mae differ from the “correct” answer even though it doesn’t throw an error?
    Please don’t send me on an Easter egg hunt this time.

I don’t understand what you mean by:

As far as windowing is concerned, the window size to use is 10. Here’s the relevant text:

The reason you don’t get an error is because the shapes match when it comes to elementwise operations.

This was my first submission:


Try Again

• Grade Received: 79% • To Pass: 80% or higher


January 12, 2023 5:22 AM MST (Highest Grade)

So I refreshed the assignment, saved and submitted it. And now the grade is zero.

Please click my name and message your notebook as an attachment.

The grader is looking for a file named C4W1_Assignment.ipynb as shown in the screenshot below:

Your notebook is named C4W1_Assignment_v2.ipynb which explains the 0 score.

Upon renaming your file and submitting, the feedback looks correct:

Thank you for doing that.
I’m still not clear why my “diff_moving_avg_plus_smooth_past” module is incorrect. Can you explain?

Your window size is 11. The required window size is 10.


Here are some hints to fix mistakes in the notebook:

  1. Keep in mind that validation series is towards end of the dataset. So, it’s sufficient to take last few points in time:
# Perform the correct slicing
diff_moving_avg = ...
  1. In snippet below, you are expected to take elements from 1 year before SPLIT_TIME. The left endpoint should start before SPLIT_TIME and the right end point should be 1 year lesser than
    the actual length of past_series.
# Slice the whole SERIES to get the past values

More hints based on your recent notebook:

Please follow these steps to refresh your workspace. Look for Click here for hints in the notebook (which is missing in your version).

1 Like