AI

Prediction & Forecasting

Prediction & Forecasting #

Prediction and forecasting use statistical models to estimate unknown or future values.

In this module, the focus is on correlation, regression, and time series forecasting.

Key takeaway:
Prediction estimates a value using a model.

Forecasting is prediction where the order of time matters.

  • Correlation
  • Regression
  • Time series analysis
  • Components of time series data
  • Moving average and weighted moving average
  • AR model
  • ARMA model
  • ARIMA model
  • SARIMA and SARIMAX
  • VAR and VARMAX
  • Simple exponential smoothing

Prediction vs Forecasting ☆ #

ConceptMeaningExample
PredictionEstimate an unknown outputPredict house price from area and rooms
ForecastingPredict future values using time orderForecast sales for next month
All forecasting is prediction, but not all prediction is forecasting.

Overall Workflow #

flowchart LR
    A[Data] --> B[Explore Pattern]
    B --> C[Choose Model]
    C --> D[Train or Fit]
    D --> E[Validate]
    E --> F[Predict or Forecast]
    F --> G[Interpret Error]

    style A fill:#E1F5FE
    style B fill:#C8E6C9
    style C fill:#FFF9C4
    style D fill:#EDE7F6
    style E fill:#C8E6C9
    style F fill:#E1F5FE
    style G fill:#FFF9C4

Correlation ☆ #

Correlation measures the direction and strength of linear relationship between two variables.

Clusters, Hadoop, and Spark

Clusters, Hadoop, and Spark #

Scale-out frameworks distribute data and computation across networked machines. Their value comes from aggregate compute and storage, while their main costs are communication, scheduling, serialisation, and repeated synchronisation.

Course coverage:

  1. Cluster computing with Hadoop and Spark
  2. MapReduce k-means, mini-batch and streaming variants
  3. Convergence and communication reduction
  4. Distributed convolutional neural networks: data and model parallelism
  5. Layer or tensor slicing, mixed precision, pipelining, and distributed execution frameworks

Learning Objectives #

By the end of this page, you should be able to:

Evolutionary and Population-Based Search

Evolutionary and Population-Based Search #

Population-based search explores with many candidate solutions at once. Genetic Algorithms evolve encoded solutions, Ant Colony Optimisation builds paths using collective pheromone signals, and neuroevolution applies evolutionary ideas to neural-network design.

  • Genetic Algorithm

  • Ant Colony Optimisation

  • Neural Architecture Search

  • Use case : Neuro Evolution - Evolutionary computation to design or train neural networks

Learning Objectives #

  • explain the purpose of population-based search
  • describe representation, fitness, selection, crossover and mutation
  • trace the core Genetic Algorithm loop and one numerical iteration
  • explain exploration and exploitation in Ant Colony Optimisation
  • interpret the main ACO transition and pheromone-update equations
  • distinguish NAS, NEAT, DeepNEAT and CoDeepNEAT

Big Picture #

flowchart TD
    P["Population-based search"] --> G["Genetic Algorithms"]
    P --> A["Ant Colony Optimisation"]
    G --> N["Neuroevolution"]
    N --> D["Deep network design"]

    style P fill:#E1F5FE
    style G fill:#C8E6C9
    style A fill:#FFF9C4
    style N fill:#EDE7F6
    style D fill:#C8E6C9

1. Why Use a Population? ☆ #

A single-state method follows one candidate through the search space. A population-based method maintains several candidates in parallel.

Gaussian Mixture Model & Expectation Maximization

Gaussian Mixture Model & Expectation Maximization #

A Gaussian Mixture Model represents data as a weighted combination of multiple Gaussian distributions.

It is commonly used for soft clustering and density estimation.

Key takeaway:
K-means gives hard cluster membership.

GMM gives probabilities of belonging to each cluster.

  • Gaussian Mixture Model
  • soft clustering
  • mixing coefficients
  • latent variables
  • likelihood and log-likelihood
  • Expectation-Maximization algorithm
  • E-step and M-step
  • responsibilities
  • convergence

Motivation ☆ #

Many real datasets are not described well by one Gaussian distribution.

Instance-based Learning

Instance-based Learning #

Instance-based learning is a family of methods that do not build one explicit global model during training. Instead, they store training examples and delay most of the work until a new query arrives.

When a new point must be classified or predicted, the algorithm compares it with previously seen examples, finds the most relevant neighbours, and uses them to produce the answer.

Instance-based Learning covers three linked ideas:

Temporal-Difference Learning I

Temporal-Difference Learning I #

Temporal-Difference (TD) learning updates predictions from one transition at a time. It learns directly from experience like Monte Carlo methods, but it does not need to wait until the episode ends.

Course Content covered in this module:

  • Temporal-Difference Learning
  • TD(0), SARSA, Q-Learning and Expected SARSA
TD learning updates an estimate using an immediate reward and another current estimate.

Learning Objectives #

By the end of this module, you should be able to:

Support Vector Machine

Support Vector Machine (SVM) #

Support Vector Machine (SVM) is a supervised machine learning algorithm used for:

  • Classification (most common)
  • Regression (SVR – Support Vector Regression)

It connects many earlier ideas:

  • classification and decision boundaries
  • linear classifiers
  • margins
  • optimisation
  • constrained optimisation
  • kernels for non-linear data

SVM is a discriminative classifier.

That means it does not try to model how each class is generated.

Instead, it tries to find the best separating boundary between classes.

Distributed Training Strategies

Distributed Training Strategies #

Distributed training combines devices to increase throughput, fit larger models, or shorten time to solution. The central design question is what to partition: examples, model parameters, layers, tensors, or the training schedule.

Course coverage:

  1. Data parallelism
  2. Model parallelism
  3. Pipeline parallelism and micro-batches
  4. Gradient checkpointing
  5. Mixed-precision training and loss scaling

Learning Objectives #

By the end of this page, you should be able to:

  • compare data, model, and pipeline parallelism
  • calculate global batch size, speedup, efficiency, and effective throughput
  • explain gradient aggregation through all-reduce
  • calculate simple pipeline time and utilisation
  • quantify the memory–computation trade-off of checkpointing
  • explain mixed precision and loss scaling

Big Picture #

flowchart TD
    A["Training Constraint"] --> B["More Data Throughput"]
    A --> C["Model Too Large"]
    A --> D["Activation Memory Too High"]
    B --> E["Data Parallelism"]
    C --> F["Model or Pipeline Parallelism"]
    D --> G["Checkpointing or Mixed Precision"]

    style A fill:#E1F5FE
    style B fill:#C8E6C9
    style C fill:#FFF9C4
    style D fill:#EDE7F6
    style E fill:#E1F5FE
    style F fill:#C8E6C9
    style G fill:#FFF9C4

1. Data Parallelism ☆ #

Each worker holds a complete model replica and processes a different shard of the mini-batch.

Game Playing and Adversarial Search

Game Playing and Adversarial Search #

Game-playing agents search in environments where other agents influence the outcome. In competitive games, a good move must account not only for what the agent wants to achieve, but also for the strongest response an opponent can make.

  • Searching to play games

  • Minimax Algorithm

  • Alpha-Beta Pruning

  • Monte Carlo Tree Search

  • Stochastic Games

Learning Objectives #

  • formulate a game as an adversarial search problem
  • construct a game tree with alternating MAX and MIN turns
  • design and interpret a static evaluation function
  • back up values using Minimax
  • apply Alpha-Beta Pruning and identify cut-offs
  • explain the four phases of Monte Carlo Tree Search
  • calculate an MCTS selection score using UCB1
  • evaluate chance outcomes in a stochastic game

Big Picture #

flowchart TD
    A["Game state"] --> B["Generate legal moves"]
    B --> C["Build game tree"]
    C --> D["Evaluate leaves"]
    D --> E["Choose robust action"]
    E --> A

    style A fill:#E1F5FE
    style B fill:#FFF9C4
    style C fill:#EDE7F6
    style D fill:#FFF9C4
    style E fill:#C8E6C9

In normal search, the agent controls its own actions and the transition model determines what happens next. In adversarial search, another agent chooses actions that may reduce the first agent’s utility.

Temporal-Difference Learning II and DRL Taxonomy

Temporal-Difference Learning II and DRL Taxonomy #

One-step TD methods bootstrap after a single transition. Multi-step methods instead use several observed rewards before bootstrapping, forming a bridge between TD(0) and Monte Carlo learning.

Course Content covered in this module:

  • Temporal-Difference Learning: n-step returns and TD(λ)
  • Classification of Reinforcement Learning approaches, algorithms and applications:
    • Model-Based versus Model-Free
    • Value-Based versus Policy-Based
    • On-Policy versus Off-Policy
The number of sampled steps controls how far learning looks ahead before it bootstraps.

Learning Objectives #

By the end of this module, you should be able to: