1. Home
  2. Explore
  3. Computer Science
  4. Machine Learning Introduction

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

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 EEE with respect to some class of tasks TTT and performance measure PPP, if its performance at tasks in TTT, as measured by PPP, improves with experience EEE. — 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)(x_i, y_i)(xi​,yi​), the goal is to learn a function fff 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\mathcal{D}D of nnn labeled data points:

D={(x1,y1),(x2,y2),…,(xn,yn)}\mathcal{D} = \{(x_1, y_1), (x_2, y_2), \dots, (x_n, y_n)\}D={(x1​,y1​),(x2​,y2​),…,(xn​,yn​)}

where:

  • xix_ixi​ is the feature vector (input data).

  • yiy_iyi​ 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 PPP. 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 PPP; we only observe samples from it.

Goal

Learn a function f:X→Yf: \mathcal{X} \to \mathcal{Y}f:X→Y that accurately predicts yyy from xxx for new, unseen data points.

Feature Space X\mathcal{X}X

In this course, X\mathcal{X}X is typically the ddd-dimensional space of real numbers:

X=Rd\mathcal{X} = \mathbb{R}^dX=Rd

Each data point is represented as a vector of ddd 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\mathcal{Y}Y — Examples

Binary Classification Y={0,1}\mathcal{Y} = \{0,1\}Y={0,1} or {−1,+1}\{-1,+1\}{−1,+1}

  • Spam detection (spam vs. not spam)

  • Face detection (face present vs. absent)

Multi-class Classification Y={1,2,…,K}\mathcal{Y} = \{1,2,\dots,K\}Y={1,2,…,K} (K classes)

  • News article categorization (sports, politics, entertainment, etc.)

  • Digit recognition (0–9)

Regression Y=R\mathcal{Y} = \mathbb{R}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 ddd be the vocabulary size (e.g., 1 million English words). For each document, create a vector of length ddd where position jjj holds the count of word jjj 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)(x_i, y_i)(xi​,yi​) to automatically learn a function f:Rd→Yf: \mathbb{R}^d \to \mathcal{Y}f:Rd→Y that can predict yyy from new xxx. 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.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent