Imagine you want to teach a computer to recognize cats.
Traditional programming approach: You write rules—“pointy ears are cats,” “whiskers are cats,” “meows are cats”…
But cats come in countless variations; you can’t write all the rules.
Machine learning approach: You show the computer 10,000 cat photos, telling it “this is a cat.” The computer discovers cat features by itself.
This is the core idea of machine learning: Don’t tell the computer how to do it; let it learn from data.
Types of Machine Learning #
Machine learning has several main types:
Supervised Learning
Give the computer labeled data, letting it learn the relationship between inputs and outputs.
For example: Show the computer 10,000 cat photos, each labeled “cat.” After learning, the computer can recognize new cat photos.
Unsupervised Learning
Give the computer unlabeled data, letting it discover patterns by itself.
For example: Give the computer customer data, let it automatically group customers into categories.
Reinforcement Learning
The computer learns through trial and error; good behavior gets rewarded, bad behavior gets punished.
For example: Let the computer play a video game; winning scores points, losing deducts points. The computer learns how to get the highest score.
History of Machine Learning #
Machine learning isn’t new technology; it has a long history.
1950s: Turing asked “Can machines think?” The earliest machine learning programs appeared.
1959: Arthur Samuel developed a checkers program that could self-learn. He coined the term “machine learning.”
1960s: Perceptron appeared, the precursor to neural networks.
1980s: Decision trees, support vector machines, and other algorithms emerged. But computing power was limited; few applications.
1990s: Machine learning became practical. Spam filtering, handwriting recognition, and other applications appeared.
2000s: Random forests, gradient boosting, and other algorithms became popular. Netflix Prize drove recommendation system development.
2010s: Deep learning exploded; AI entered a new era.
Classic Algorithms #
Machine learning has many classic algorithms:
Linear Regression
Predict continuous values. Like predicting house prices from house size.
Logistic Regression
Classification problems. Like predicting whether an email is spam.
Decision Tree
Make decisions using tree structure. Like: if age > 30 and income > 50000, approve loan.
Random Forest
Multiple decision trees voting. More accurate, more stable.
Support Vector Machine (SVM)
Find the best boundary line to separate different categories.
K-Nearest Neighbors (KNN)
Find the nearest neighbors and see what category they belong to.
Naive Bayes
Probability-based classification. Often used for spam filtering.
K-means Clustering
Divide data into K groups. Often used for customer segmentation.
These algorithms are still used today, each with suitable scenarios.
Machine Learning Applications #
Machine learning is already everywhere:
Spam Filtering
Gmail automatically identifies spam with over 99% accuracy.
Recommendation Systems
Netflix recommends movies, Amazon recommends products, TikTok recommends videos.
Image Recognition
Face recognition, license plate recognition, medical image diagnosis.
Speech Recognition
Siri, Alexa, and Xiao Ai can all understand what you say.
Natural Language Processing
Machine translation, sentiment analysis, intelligent customer service.
Fraud Detection
Banks detect abnormal transactions to prevent credit card fraud.
Autonomous Driving
Tesla and Waymo use machine learning to recognize roads and obstacles.
Limitations of Machine Learning #
Machine learning isn’t omnipotent.
Needs lots of data: Too little data and models can’t learn.
Needs labeling: Supervised learning requires human-labeled data, which is expensive.
Black box problem: Deep learning models are hard to explain why they make certain decisions.
Bias problem: If training data has bias, the model will have bias too.
Adversarial attacks: Carefully designed inputs can fool models.
Generalization ability: Models may perform poorly on new data.
Machine Learning Workflow #
A machine learning project typically includes:
1. Data collection: Get relevant data
2. Data cleaning: Handle missing values, outliers
3. Feature engineering: Select and construct useful features
4. Model selection: Choose appropriate algorithm
5. Model training: Train model with data
6. Model evaluation: Test model performance
7. Model deployment: Apply model to real scenarios
8. Continuous monitoring: Monitor model performance, retrain if necessary
From Machine Learning to Deep Learning #
A branch of machine learning—deep learning—exploded in the 2010s.
Deep learning uses multi-layer neural networks, can automatically learn features without human design.
Deep learning achieved breakthrough progress in image recognition, speech recognition, and natural language processing.
Tomorrow, we’ll discuss the deep learning explosion.
Today’s Key Concepts #
Machine Learning Letting computers learn from data instead of explicit programming. Machine learning includes supervised learning, unsupervised learning, and reinforcement learning.
Supervised Learning Training models with labeled data. The model learns the relationship between inputs and outputs, then can predict outputs for new data. Classification and regression are common supervised learning tasks.
Feature Engineering Selecting and constructing features useful for prediction. Feature engineering is a key step in machine learning; good features can greatly improve model performance.
Discussion Questions #
- Traditional programming requires humans to write rules; machine learning lets computers learn by themselves. Which approach do you think is better?
- Machine learning is already everywhere. Can you think of other machine learning applications in life?
Tomorrow’s Preview: The Deep Learning Explosion—how did AlphaGo defeat the world champion and shock the world?