C4W1 Assignment train_val_split problem

Tests are failing even though I’m usre I’ve conned this function correctly. What am I doing wrong? I’m using time_step in the function body instead of SPLIT_TIME.

1 Like

Posting code in a public topic is discouraged and can get your account suspended. It’s okay to share stacktrace on a public post and send code to a mentor via direct message. Please clean up the post. Here’s the community user guide to get started.

If you haven’t changed the value of SPLIT_TIME manually, click my name and message your notebook as an attachment.

1 Like

I got full score upon submitting your notebook to the grader.
It’s possible that you:

  1. Made changes after submitting to the grader and this latest version of the notebook passes all the test cases.
  2. Submitted a different notebook (remember that C4W1_Assignment.ipynb is the only notebook accepted by the grader).

Please submit the notobook you shared with me via direct message for grading. Should you not get the full score, share the grader feedback I’ll notify the staff of grader issues.

1 Like

Thank you! I had an extra code cell later in the notebook where I was evaluating some code and it had an exception, which I only noticed and I removed before sending you the notebook. That must have been where the problem was.

Thank you, now I’m getting full grade!

1 Like

Here’s a hint to fix train_val_split:
Please use function parameters and local variables instead of global variables when possible.

Thank you sir! It is solved


Please help me understand why this hint wasn’t helpful?

Thank you for the quick response. I did intend to use the local variables inside the function, but the third argument was capitalized and it acted as a magnet. Sorry for silly disturbance.