Help! Unable to clear week 2 lab assignment in MLS 1


This is how this place works. When you encounter an error, chance is that it has been discussed previously, and please search this forum for similar post for mentors’ and learners’ comments. Sometimes they might provide you some general debugging steps, and sometimes they might share some very insightful comments. Either way should help you spot the problem. Sometimes this is a lengthy process, and it is especially the case when you are not familiar with Python.

However, we don’t fix problems for learners, because bug-fixing is learner’s resposibility and learning opportunity. We expect learners to allocate enough time, and learn whatever it takes to finish the assignment on their own. It is your job.

If you take this course as the first step to master Machine Learning in the long run, here are my suggestions:

  1. check this post out again, and particularly read part C point number 1 for what you can expect to go through in each exercise.

  2. spend 30 minutes to read through this post. Try to understand the rationale behind this debugging approach, and practice it in your exercises. If you understand what you are doing, and if you print out what your code is doing, then you can compare your understanding with the code. If your code isn’t delivering what are you expecting for, then you spot a place to make correction!

  3. Learn whatever Python that is unclear and is in your way.

@Krishnaraj1, this is not a solution to the error in your assignment, but this is a solution to learning Machine Learning here. If you don’t have the time for this, then please come back later when you have the time. If you have the time for this, try!