Machine Learning Introduction
Introduction to Machine Learning
What Is Machine Learning?
Machine learning addresses problems where it is difficult or impossible for a programmer to write an explicit program. In traditional computer science, a programmer writes code that transforms input data into desired output — for example, a program that decodes an MP3 file into audio waveforms. This approach works when the transformation is well understood and can be specified algorithmically.
In machine learning, the scenario is different: a physician might want to know whether an fMRI scan indicates Alzheimer's disease, but there is no known algorithm to extract that information. Instead, the machine learning approach collects past data for which the correct output is already known (e.g., historical fMRI scans with known diagnoses). This labeled data is fed into a learning algorithm, which outputs a program (or a set of parameters) that can map new input data to the desired output. The process has two phases:
Training: The learning algorithm processes the labeled dataset to produce a program.
Testing: The learned program is applied to new, unseen data to make predictions.
The crucial insight is that the computer programs itself, often producing solutions that humans would not know how to write explicitly.
A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E. — Tom Mitchell, 1997
In short, machine learning algorithms improve on tasks with experience (more data leads to better performance).
Historical Context
Early Beginnings
Samuel's Checkers Player (1952): The first algorithm that learned from experience. It stored moves and improved through play. Checkers is now a solved game — every position has a known optimal move.
Perceptron (1957) — Frank Rosenblatt: A foundational algorithm that remains in use today. It was the precursor to artificial neural networks and deep learning. Rosenblatt's insight was nearly 90% of modern neural network ideas, limited only by computing power (the entire world's computational capacity in 1957 was less than a modern phone).
The AI Winter
The perceptron generated enormous excitement and funding for artificial intelligence. However, in a 1969 book, Minsky and Papert showed that a single-layer perceptron cannot learn the XOR dataset — a simple four-point classification problem. This limitation, easily understood by everyone, destroyed confidence in AI. Funding collapsed worldwide, a period known as the AI winter. To distance themselves from the stigma, many researchers rebranded their work as "machine learning."
Key Difference: AI vs. Machine Learning
AI: Top-down, logic-based, aimed at mimicking human reasoning (often portrayed as purely logical beings).
Machine Learning: Bottom-up, data-driven, focused on statistics and optimization rather than logic. This approach embraces uncertainty — something statisticians had been handling for centuries.
The Turning Point: TD-Gammon (1994)
Gerry Tesauro wrote a backgammon program that used an artificial neural network to choose moves. At first, the program played randomly. Tesauro then let the program play against itself millions of times. The program received positive feedback for winning moves and negative feedback for losing moves. Overnight, it improved to beat Tesauro himself. It then went on to challenge and defeat the world champion. During the match, the program invented a novel opening move that the champion initially considered weak, but later adopted after analysis — the program had discovered a genuinely new strategy.
Deep Blue (1997)
IBM's Deep Blue beat chess world champion Garry Kasparov, but this used traditional minimax AI with handcrafted evaluation functions rather than learning from experience.
Modern Applications
Machine learning is now woven into everyday technology:
Search Engines (Google, Yahoo, Bing): Human labelers evaluate search results (good/bad). A learning algorithm uses these labels to rank pages. The system learns what users want, even with only three query words.
Spam Filters: Spam is highly adversarial (spammers constantly change tactics) and subjective (what is spam for one person may not be for another). A learned filter can be continuously retrained on new examples, adapting without manual reprogramming.
News Aggregation (Google News): The system learns user interests by observing clicks and labels, then recommends relevant articles.
Self-Driving Cars: Many sensor technologies existed before, but machine learning made safe driving behavior learnable.
General Impact: Machine learning is now used in biology, chemistry, finance, and many other fields. It is widely considered a top-demand skill.
Types of Machine Learning
There are three broad categories, with this course focusing on the first:
Supervised Learning
Given a dataset of input-output pairs (xi,yi), the goal is to learn a function f that maps inputs to outputs. Examples: spam detection, search ranking, medical diagnosis.
Unsupervised Learning
Given data without labels, the goal is to discover hidden structure or patterns (e.g., clustering MRI images to find subgroups).
Reinforcement Learning
An agent takes actions in an environment and receives delayed feedback (reward/punishment). Example: TD-Gammon learning to play backgammon through self-play. This is covered in AI and robotics courses.
Supervised Learning: Formal Setup
The entire course is built on this formulation.
Dataset
We are given a dataset D of n labeled data points:
where:
xi is the feature vector (input data).
yi is the label (desired output).
Data Distribution
The data points are assumed to be i.i.d. — independent and identically distributed — drawn from some unknown probability distribution P. This distribution represents the true underlying process that generates the data (e.g., the distribution of emails arriving in your inbox). We do not have direct access to P; we only observe samples from it.
Goal
Learn a function f:X→Y that accurately predicts y from x for new, unseen data points.
Feature Space X
In this course, X is typically the d-dimensional space of real numbers:
Each data point is represented as a vector of d numbers summarizing its characteristics. Any data stored on a computer is ultimately a sequence of numbers, so this representation is always possible.
Label Space Y — Examples
Binary Classification Y={0,1} or {−1,+1}
Spam detection (spam vs. not spam)
Face detection (face present vs. absent)
Multi-class Classification Y={1,2,…,K} (K classes)
News article categorization (sports, politics, entertainment, etc.)
Digit recognition (0–9)
Regression Y=R (real numbers)
House price prediction
Predicting a person's height or age
Feature Representation Examples
Patient Data (for readmission prediction) A vector could include:
Binary features: gender (0/1)
Continuous features: age in years, height in cm, blood pressure, heart rate
The label is binary: will the patient be readmitted within 6 weeks? (yes/no)
Text Documents (bag-of-words) Text is converted to a vector by ignoring word order and counting word occurrences. Let d be the vocabulary size (e.g., 1 million English words). For each document, create a vector of length d where position j holds the count of word j in the document. For example, an email containing the word "the" 5 times and "moose" 7 times, but not "zebra", would have a vector with those counts. This surprisingly simple representation works well for tasks like spam detection and topic classification.
Summary
Supervised learning uses labeled data (xi,yi) to automatically learn a function f:Rd→Y that can predict y from new x. The course will develop methods for classification (binary and multi-class) and regression, with a strong emphasis on statistical and optimization-based approaches.

Ask anything
We've read this whole study set, so questions about it get the best answers.