Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Basic Concepts

Two Basic Paradigms

ParadigmDataGoalTypical Tasks
Supervised LearningInput–label pairs {(xi,yi)}i=1n\{(x_i, y_i)\}_{i=1}^nLearn a mapping x↦yx \mapsto yClassification, Regression
Unsupervised LearningUnlabeled feature vectors {xi}i=1n\{x_i\}_{i=1}^nDiscover underlying structureClustering, Dimensionality Reduction

Target Function, Hypothesis, and Hypothesis Space

ConceptDefinition
Target function t:X→Yt : \mathcal{X} \to \mathcal{Y}The unknown ground-truth mapping that generates the data: yi=t(xi)+noisey_i = t(x_i) + \text{noise}. We only observe finite data, not this function.
Hypothesis hhA candidate function used to approximate tt. Example: h(x)=θ1x1+θ2x2=θ⊤xh(x) = \theta_1 x_1 + \theta_2 x_2 = \boldsymbol{\theta}^\top x.
Hypothesis space H\mathcal{H}The set of all allowable hypotheses. Example: H={hw(x)=w⊤x:w∈Rn}\mathcal{H} = \{h_{\mathbf{w}}(x) = \mathbf{w}^\top x : \mathbf{w} \in \mathbb{R}^n\}.

Cost Function, Training, and Testing

Cost (objective) function: measures how well a hypothesis fits the training data. Using squared loss as an example:

J(h)=1n∑(xi,yi)∈Dtrain(h(xi)−yi)2J(h) = \frac{1}{n} \sum_{(x_i, y_i) \in \mathcal{D}_\text{train}} \bigl(h(x_i) - y_i\bigr)^2

Training (learning): find the best hypothesis in H\mathcal{H} by minimizing the cost on the training set (optimization):

h∗=arg⁡min⁡h∈H1n∑(xi,yi)∈Dtrain(h(xi)−yi)2h^* = \arg\min_{h \in \mathcal{H}} \frac{1}{n} \sum_{(x_i, y_i) \in \mathcal{D}_\text{train}} \bigl(h(x_i) - y_i\bigr)^2

Testing (evaluation): assess the performance of the learned model h∗h^* on the test set:

Test error=1m∑(xi,yi)∈Dtest(h∗(xi)−yi)2\text{Test error} = \frac{1}{m} \sum_{(x_i, y_i) \in \mathcal{D}_\text{test}} \bigl(h^*(x_i) - y_i\bigr)^2

General Machine Learning Workflow

  1. Data collection: gather relevant historical data.

  2. Data preprocessing: handle missing values, outliers, and data quality issues.

  3. Model design: choose the hypothesis space H\mathcal{H}, objective function JJ, and optimization method.

  4. Training: learn model parameters from training data.

  5. Testing: evaluate performance on unseen test data.

  6. Model improvement: refine the model, features, or data to improve performance.

Other Learning Paradigms

ParadigmDescription
Reinforcement Learning (RL)An agent interacts with an environment over time, taking actions to maximize expected cumulative reward. At each step tt: observe state sts_t, take action ata_t, receive reward rtr_t, transition to st+1s_{t+1}.
Semi-supervised learningLearning from a mixture of labeled and unlabeled data, typically when labeled data is scarce.
Ensemble learningCombining predictions from multiple models to obtain a final decision, often improving robustness and accuracy.
Transfer learningLeveraging knowledge learned from a source domain to improve learning in a target domain, especially when target data is limited.
Federated learningTraining models across distributed clients using local data, sharing only model updates (not raw data) — privacy-preserving.
Machine unlearningRemoving the influence of specific training samples from a trained model, motivated by privacy and regulatory requirements.