Part 2: Machine Learning, Deep Learning, and Foundation Models
Why These Three Matter
Machine Learning: Learning Rules from Data
The Three Types of Machine Learning
1. Supervised Learning — "Learn from Labeled Examples"
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.datasets import load_iris
from sklearn.metrics import accuracy_score
# Load a dataset with labels
iris = load_iris()
X, y = iris.data, iris.target
# Split into training and test sets
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=42
)
# Train: the model learns the relationship between features and labels
model = RandomForestClassifier(n_estimators=100, random_state=42)
model.fit(X_train, y_train)
# Predict on data the model has never seen
predictions = model.predict(X_test)
print(f"Accuracy: {accuracy_score(y_test, predictions):.2%}")
# Accuracy: 100.00%2. Unsupervised Learning — "Find Structure in Unlabeled Data"
3. Reinforcement Learning — "Learn by Trial and Reward"
When to Use Which Type
Type
You Need
You Get
Example
Deep Learning: Neural Networks with Many Layers
What Makes It "Deep"?
A Simple Neural Network in Python
Key Deep Learning Architectures
Architecture
Best For
How It Works
When Deep Learning Beats Traditional ML
Foundation Models: The Paradigm Shift
What is a Foundation Model?
What Changed
Why Foundation Models Work
The Foundation Model Stack
Comparing All Three: ML vs DL vs Foundation Models
Decision Framework
Factor
Traditional ML
Deep Learning
Foundation Model
Ten Real-World ML Use Cases You Encounter Daily
From My Own Experience: Choosing the Right Level
What's Next
PreviousPart 1: What is Artificial Intelligence?NextPart 3: Natural Language Processing — NLP, NLU, and NLG
Last updated