How to recognize mistakes

I would like to dedicate this thread to teaching those who come behind us how to recognize mistakes and how to fix them (or avoid them). This is not a thread for questions, but for answers.

In the middle of lesson ML lesson 3, @jeremy warned that we were all going to make mistakes, that even he makes tons of mistakes, it’s very frustrating, but over time he’s learned to recognize his mistakes, and that unfortunately he can’t tell us how to avoid mistakes.

I believe that recognizing mistakes is something which is teachable / learnable. (For example, if it says, “name ‘np’ is not defined”, that means I forgot to import np, to use a trivial example.) Stack Overflow is fantastic for discovering other people learning from their mistakes. However, Stack Overflow is best at dealing with simple mistakes like forgetting an import, not so much for squishier mistakes (like, “I used data from the entire 17 years when I should have just used the past three or four”).

(I’m not actually sure how to categorize this thread because it applies across all of the classes, but it is not theory and is not only a beginner question…)

Doing something like this is useful, i.e. let your program recognize some of the mistakes for you:

1 Like

Here’s a lesson I learned:

When I know my code isn’t working, I should either start at the beginning and work forwards, or, start at the end and work backwards, but I should avoid jumping around, since doing so leaves open the possibility that I’ll jump over the bug.

This lesson may have exceptions, and I’d be interested in hearing about them, but it’s one I’ve found valuable. No more will I say wrongly to myself, “I’ve looked at everything! This doesn’t make any sense!”

If your training error is significantly lower than your validation error, you are overfitting.