Phase 02: ML Fundamentals

What Is Machine Learning

Machine learning is teaching computers to find patterns in data instead of writing rules by hand. Explain the difference between supervised, unsupervised, and reinforcement learning and identify which type applies to a given problem. Implement a nearest centroid classifier from scratch and evaluate it against a random baseline. Distinguish between classification and regression tasks and select the appropriate loss function for each. Evaluate whether a given business problem is suitable for ML or better solved with deterministic rules. You want to build a spam filter. The traditional approach: sit down and write hundreds of rules. "If the email contains 'FREE MONEY', mark it spam. If it has more than 3 exclamation marks, mark it spam." You spend weeks writing rules. Then spammers change their wording. Your rules break. You write more rules. The cycle never ends. Machine learning flips this. Instead of writing rules, you give the computer thousands of labeled emails ("spam" or "not spam") and let it figure out the rules on its own. The computer finds patterns you never would have thought of. When spammers change tactics, you retrain on new data instead of rewriting code. This shift from "programming rules" to "learning from data" is the core of machine learning. Every recommendation engine, voice assistant, self-driving car, and language model works this way. Traditional programming and…

What Is Machine Learning: Machine learning is teaching computers to find patterns in data instead of writing rules by hand. Explain the difference between…

This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.

Browse the complete course catalog or open this lesson on GitHub.