AI Academy: Lesson 3

1. Classifications of Machine Learning

So far, we have learned how models classify items into binary options (Lesson 1) and predict continuous numbers (Lesson 2).

Today, we explore the two main branches of Machine Learning architectures:
Supervised Learning: The computer learns with an answer key (Labeled Data).
Unsupervised Learning: The computer finds hidden patterns on its own (Unlabeled Data).

Let's step through both types with visual sorting simulations to see the difference.

Supervised (Answer Key)
vs
Unsupervised (Self-Patterning)

2. Supervised Learning: Labeled Stickers

In Supervised Learning, we feed the model data that has already been labeled with the correct answer (the target sticker).

Adjust the sliders to slide and rotate the blue decision line on the conveyor chart. Because the fruits have stickers showing **"Apple"** or **"Orange"**, the algorithm has an answer key to evaluate and train its line!

Redness (Color)
Weight (Size)
Accuracy: --

3. Unsupervised: Clustering the Unknown

Now, imagine you land on an alien planet and find a massive pile of strange, unknown items. There are **no stickers, no labels, and no answer key**.

This is Unsupervised Learning. We ask the AI to find patterns without tellings it what to look for. Click "Group Objects" and watch the AI sort by structural shape and texture similarity!

Shapes Group A
Shapes Group B
Shapes Group C

4. Notebook Playground: Customer Personas

Let's use Unsupervised Clustering to discover hidden customer personas in a messy retail database. Run Cell 1 to load the data, then follow prompts to set `k` (the cluster count) in Cell 4.

Markdown
Goal: Cluster customer profiles into distinct marketing personas based on spending scores and ages using K-Means.
Code [1]
import pandas as pd
data = pd.read_csv("customer_spending.csv")
print(data.head())
Output will display here...
Code [2]
import matplotlib.pyplot as plt
plt.scatter(data['age'], data['spending_score'], color='gray')
plt.show()
Output will display here...
Code [3] Prompt: Edit the variable k below (try 3 or 4) to tell the AI how many clusters/groups to look for, then hit Run.
Output will display here...
Code [4]
plt.scatter(data['age'], data['spending_score'], c=labels, cmap='rainbow')
plt.title("Discovered Customer Personas")
plt.show()
Output will display here...

5. Core Concept Summary

You have completed Lesson 3! Let's review the cheat sheet for classifications of machine learning.

🎯 Supervised Learning
Training an AI model with an **answer key** (Labeled Data).
• **Use Cases:** Spam filters (Spam vs. Not Spam), Medical diagnosis imaging (Tumor vs. Benign), Employee churn prediction.
🔮 Unsupervised Learning
Giving **unlabeled raw numbers** to an AI and asking it to group/cluster items by similarity.
• **Use Cases:** Customer segmentation (marketing), Netflix/Amazon recommendation engines, transaction fraud anomaly detection.
👑 The Golden Rule
If you know exactly what you are looking for, use **Supervised**. If you want the AI to surprise you with hidden patterns and structures you didn't know existed, use **Unsupervised**.
Narration (Professor Lyra)
Click "Start Lesson" below to begin.