Chapter 1 of 2
Course Progress0 of 2 completed (0%)

Machine Learning Foundations · Chapter 1 · ~15 min · Beginner

What is Machine Learning? Teaching Computers from Examples

Strip away the hype around artificial intelligence. Learn how machine learning flips traditional programming on its head, discover the 3 main families of ML, and understand the difference between Classification and Regression.

  • Learn how ML differs from traditional rule-based coding
  • Understand Supervised, Unsupervised, and Reinforcement Learning
  • Master Classification (categories) vs Regression (numbers)
  • Define Features (X) and Labels (y) with clear examples

1The Big Shift: Programming vs. Machine Learning

For decades, computer programming worked in one way: a human engineer sat down and wrote out every single rule by hand:

Traditional Programming

Rules + Data = Answers

You write: if (email.contains("free money")) return SPAM;. But spammers change words to "free m0ney", and your manual rule breaks!

Machine Learning

Data + Answers = Rules!

You give the computer 1,000,000 spam emails and 1,000,000 normal emails. The computer learns the patterns automatically!

Concept Check

What is the fundamental difference between traditional programming and machine learning?

2The 3 Main Families of Machine Learning

Virtually every AI and ML application fits into one of these three broad categories:

1. Supervised

Learning with a Teacher

Trained on labeled examples (e.g. 5,000 house photos with their exact sale prices). The algorithm learns to map inputs to outputs.

2. Unsupervised

Finding Hidden Patterns

No labels provided! The computer groups similar items together (e.g. clustering bank customers into spending habits).

3. Reinforcement

Trial and Error

An agent interacts with an environment and learns by getting rewarded for good moves and penalized for bad ones (e.g. Chess AI, robot walking).

Concept Check

If a hospital feeds an algorithm 50,000 X-ray scans that are each labeled 'Pneumonia' or 'Healthy', which type of ML is being used?

3Classification vs. Regression

Within Supervised Learning, there are two main types of problems:

Classification (Predicting Categories)

The output is a discrete category or label:

  • • Spam or Not Spam?
  • • Fraudulent transaction or Legitimate?
  • • Cat, Dog, or Bird?

Regression (Predicting Numbers)

The output is a continuous numerical value:

  • • What will this house sell for? ($385,000)
  • • Tomorrow's temperature in London? (68°F)
  • • Uber ride arrival time? (14 minutes)
Concept Check

Predicting whether a bank loan applicant will 'Default' or 'Pay On Time' is an example of what type of problem?

4Features (X) and Labels (y)

In machine learning literature and code, you will always see the symbols X and y:

  • Features (X): The inputs. The measurable clues the computer examines. For house prices: square footage, number of bedrooms, zip code.
  • Label (y): The target output. The answer the computer is trying to predict: the sale price.

5Hands-On: Test an ML Fruit Classifier

Use the interactive model below. Adjust the weight and texture features to see how the classifier updates its prediction and confidence:

Live Machine Learning Classifier (Fruit Predictor)

Supervised Classification
150 g
Light (100g)Medium (175g)Heavy (250g)
Model Prediction Output (Label y):Confidence: 95%
Predicted Class:

Apple 🍏

P(Apple) = 95%

P(Orange) = 5%

6Chapter Knowledge Challenge

Test your machine learning intuition on classification, regression, features, and labels:

Concept Check 1 of 2
1

Classifying incoming emails as 'Spam' or 'Inbox' is an example of what type of machine learning task?

Concept Check 2 of 2
2

In a house price prediction model with square footage, number of bedrooms, zip code, and selling price, which is the Label (y)?

7Recap

  • Machine Learning trains algorithms on data so computers discover patterns and rules automatically.
  • The 3 families are Supervised (labeled data), Unsupervised (unlabeled clustering), and Reinforcement (reward signals).
  • Classification predicts discrete categories; Regression predicts continuous numerical quantities.
  • Features (X) are the input clues; Labels (y) are the target answers.

Ready for Chapter 2? Mark this chapter as complete to proceed:

Enjoying this free lesson? Your support helps us build more free animated chapters.

Support Us