Optimisation vs
Prediction
UNDERSTANDING THE DIFFERENCES
Data science
Statistics
Machine learning
Optimisation
2
Data science
Statistics
◦ Transparency
◦ Does X affect Y?
◦ Direction of effect
Machine learning
◦ Prediction
◦ More complicated problems (e.g. computer vision)
Optimisation
◦ How to find X to max/min Y?
3
Predictive analytics
What will the demand for my product be in time X?
What will traffic look like based on day/time/month?
How busy will the hospitals in our city be based on day/time/month?
How much load will there be on our servers based on the number of users, and the time of the
day?
4
Optimisation
Find the best price and deals to optimise demand for the product
Optimise the traffic lights in order to improve flow
Allocate the right number of ambulances and doctors across the week to reduce waiting times
Optimise resource allocation
5
Prediction + optimisation
Confused because sometimes you need to combine
You build a predictive model
◦ 𝑓 𝑥1, 𝑥2, … , 𝑥 𝑛 = 𝑦
◦ Find 𝑥1, 𝑥2, … , 𝑥 𝑛 to minimise/maximise y
6
Optimisation
Operations research
◦ Travelling salesman problem
◦ Knapsack problem
◦ Vehicle routing
◦ Supply chains
7
Travelling salesman
Go through each city
without passing by twice from the same one
8
Knapsack problem
Given a set of items, each with a weight and a value, determine the number of each item to
include in a collection so that the total weight is less than or equal to a given limit and the total
value is as large as possible.
Maximise value
Minimise weight
9
Some common optimisation algorithms
Standard routines
◦ Linear programming (e.g. simplex method)
◦ Integer programming
◦ Non-linear optimisation (e.g. BFGS)
Metaheuristics
◦ Genetic algorithms
◦ Swarm optimisation
◦ Evolution strategies
◦ Simulated annealing
10
Genetic algorithms
Better suited for hard non-linear problems
◦ E.g. huge parameter space
Very easy to parallelise!
◦ Very important when you have a cloud server
Might require multiple runs
◦ Due to randomness
11
How to
Matlab
◦ https://www.mathworks.com/products/optimization.html
Scipy
◦ https://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html
Other R or Python libraries
◦ https://cran.r-project.org/web/views/Optimization.html
◦ https://github.com/DEAP/deap for Python
12
Decision maker heuristics
How do I make the most out of my resources?
How do I minimise X?
◦ Time
◦ Cost
How do I maximise Y?
◦ Profit
◦ Time spent on the page
13
Tips and tricks for decision makers
Global optima are rarely guaranteed in the real world
◦ But you can get pretty close to them
Optimisation algorithms are sensitive
◦ You need to formulate two things
1. Objective function
2. Constraints (e.g. money spent on advertising can’t be more than the monthly budget)
You need an experienced data scientist
◦ And also knowledge of the domain
Be aware of the costs and time
◦ You will likely be solving 2 problems (prediction + optimisation)
14
Learn more
Tesseract Academy
◦ http://tesseract.academy
◦ https://youtu.be/7oJRaxrIqNw
◦ Data science, big data and blockchain for executives and managers.
The Data scientist
◦ Personal blog
◦ Covers data science, analytics, blockchain, tokenomics and many more subjects
◦ http://thedatascientist.com/genetic-algorithms-neural-networks/
Optimisation vs prediction

Optimisation vs prediction

  • 1.
  • 2.
  • 3.
    Data science Statistics ◦ Transparency ◦Does X affect Y? ◦ Direction of effect Machine learning ◦ Prediction ◦ More complicated problems (e.g. computer vision) Optimisation ◦ How to find X to max/min Y? 3
  • 4.
    Predictive analytics What willthe demand for my product be in time X? What will traffic look like based on day/time/month? How busy will the hospitals in our city be based on day/time/month? How much load will there be on our servers based on the number of users, and the time of the day? 4
  • 5.
    Optimisation Find the bestprice and deals to optimise demand for the product Optimise the traffic lights in order to improve flow Allocate the right number of ambulances and doctors across the week to reduce waiting times Optimise resource allocation 5
  • 6.
    Prediction + optimisation Confusedbecause sometimes you need to combine You build a predictive model ◦ 𝑓 𝑥1, 𝑥2, … , 𝑥 𝑛 = 𝑦 ◦ Find 𝑥1, 𝑥2, … , 𝑥 𝑛 to minimise/maximise y 6
  • 7.
    Optimisation Operations research ◦ Travellingsalesman problem ◦ Knapsack problem ◦ Vehicle routing ◦ Supply chains 7
  • 8.
    Travelling salesman Go througheach city without passing by twice from the same one 8
  • 9.
    Knapsack problem Given aset of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible. Maximise value Minimise weight 9
  • 10.
    Some common optimisationalgorithms Standard routines ◦ Linear programming (e.g. simplex method) ◦ Integer programming ◦ Non-linear optimisation (e.g. BFGS) Metaheuristics ◦ Genetic algorithms ◦ Swarm optimisation ◦ Evolution strategies ◦ Simulated annealing 10
  • 11.
    Genetic algorithms Better suitedfor hard non-linear problems ◦ E.g. huge parameter space Very easy to parallelise! ◦ Very important when you have a cloud server Might require multiple runs ◦ Due to randomness 11
  • 12.
    How to Matlab ◦ https://www.mathworks.com/products/optimization.html Scipy ◦https://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html Other R or Python libraries ◦ https://cran.r-project.org/web/views/Optimization.html ◦ https://github.com/DEAP/deap for Python 12
  • 13.
    Decision maker heuristics Howdo I make the most out of my resources? How do I minimise X? ◦ Time ◦ Cost How do I maximise Y? ◦ Profit ◦ Time spent on the page 13
  • 14.
    Tips and tricksfor decision makers Global optima are rarely guaranteed in the real world ◦ But you can get pretty close to them Optimisation algorithms are sensitive ◦ You need to formulate two things 1. Objective function 2. Constraints (e.g. money spent on advertising can’t be more than the monthly budget) You need an experienced data scientist ◦ And also knowledge of the domain Be aware of the costs and time ◦ You will likely be solving 2 problems (prediction + optimisation) 14
  • 15.
    Learn more Tesseract Academy ◦http://tesseract.academy ◦ https://youtu.be/7oJRaxrIqNw ◦ Data science, big data and blockchain for executives and managers. The Data scientist ◦ Personal blog ◦ Covers data science, analytics, blockchain, tokenomics and many more subjects ◦ http://thedatascientist.com/genetic-algorithms-neural-networks/