Error on C3M4

Hi @0xJavy, welcome to the forum! :blush:

I just checked this lab, and here are the tips I have for you:

  • Please only replace the None parts and keep the exact variable names the notebook asks for. When the grader runs, it looks for specific variables with specific types. If you “shorten” or rename things (as it looks like you did, from the snippets above), your printed output can look right, but the grader won’t be able to find the expected objects.
  • In Exercise 4, the grader expects X_simple itself to already include the constant and to be the matrix used to fit the model. If you create a different variable (e.g., X) with the constant and fit with that, the grader later calls results_simple.predict(X_simple) and shapes won’t match (2 params vs 1 column) → the alignment error you saw.
  • In Exercise 5, the grader expects predictors (or numeric_features, depending on the cell) to be a Python list of column names, not a DataFrame. If you set predictors = df[[...]], its type is wrong even if the preview looks the same.

At this point, it’s probably easier for you to reset your notebook. You can refer to the instructions here, under Coursera Jupyter Lab Environment.

Good luck!