2
Most read
5
Most read
8
Most read
Price Optimisation with Python
Ammar Mohemmed
21/07/2019
• In 1985, American Airlines was threatened on its core routes by
the low-fare carrier PeopleExpress. In response, American developed
an optimisation algorithm to set the prices dynamically
• In 2012, the travel site Orbitz was found to be adjusting its prices
for users of Apple Mac computers
• The Wall Street Journal revealed that the Staples website
offered products at different prices depending on the user’s proximity
to rival stores
• Using data to adjust prices in order to achieve maximum revenue or
profit
• Price change period from a year to minutes
• Single product or multiple products
• Considering the substitute from own company and competitors
• Considering the laddering (same product but different size or weight or
count)
• New products with not enough data
• Considering other business constraints
• Demand: Quantity sold, number of vehicles, no. of passengers …
• Law of demand: that other factors being constant (cetris peribus), price
and quantity demand of any good and service are inversely related to
each other. When the price of a product increases, the demand for the
same product will fall.
• How to extract possible cofounding variables.
• Linear, polynomial or exponential relationship is fitted.
Estimate the demand vs price
relationship
Maximize the revenue by
optimization
Q = b0 + b1 * P R = (b0 + b1 * P) * P
Linear, polynomial or exponential relationship is fitted.
• Is a phenomenon in probability and statistics, in which a trend appears
in several different groups of data but disappears or reverses when
these groups are combined (Wikipedia)
Quantity increases with price, but difference of quantity decreases
Quantity
Quantity vs. price Quantity difference vs. price
Quantity
difference
Objective function:
Profit – Q1*(P1-C1) + Q2*(P2-C2) + Q3*(P3-C3)
• Variables: P1, P2, P3
• Constraints:
 Product-2 price higher than Product-3 by 1
 Product-1 higher than its cost by 0.5
 Product-1 higher than product-2 by 1.7
• Bounds:
 Max price: 50
 Min price: product cost
• Not considering cross-relationship
Any optimization problem has
three components:
1. Decision variables
2. The objective function
3. Constraints
General Optimisation Problem:
• Very difficult to solve
• Longer computation time, not
always finding the solution
• Heuristic optimization
methods
Exception:
• Least square problems
• Linear programming problems
• Convex optimisation
Business
Problem
Mathematical
Model
(python)
Solution
Modeling Algorithm
Interpretation
minimize f0(x)
subject to:
fi(x) <= 0
hi(x) = 0
X = (X0, X1, X2 … Xn)
F0(x), Rn  R objective function
hi(x), Rn  R, i = 1, …, m, constraint function
Convex
Non Convex
z = x2 + y2
• Derivative: Measures the sensitivity to change of the function value
(output value) with respect to a change in it’s argument (input value).
• Gradient: is a multi-variable generalization of the derivative. Points in
the direction of greatest increase of a function.
• Jacobian matrix: The first derivative of a vector-values function.
• Hessian matrix: is a square matrix of second-order partial derivative of
a scalar-valued function.
• scipy.optimize: Minimization of scalar function of one or more variables
Linear and Non-linear constraints
• CVXPY: Python-embedded modelling language for convex optimization
problems similar to CVX matlab
• Pyomo: It has it’s own language
• pyOpt: Nonlinear constrained optimization problems
• PuLP: It is used to describe optimization problems as mathematical
models
• Google Optimisation Tools: For solving combinatorial optimization
problems
• Noisyopt,
• Derivative based methods
o It needs to find the derivative of the objective function in away or
another
• Non-derivative based methods
o It does not need to find the derivative
o Based on the evaluation of the objective function, it will be slower
• Constraints or non-constraints methods
• Linear or Non-linear objective functions
• Stochastic and evolutionary based methods
scipy.optimize.minimize(fun, x0, args=(), method=None, jac=None,
hess=None, bounds=None, constraints=(), options=None)
• fun: The objective function
• X0: The initial value
• method: Nelder-Mead(unconstrained, no derivative), Powell
(unconstrained, no derivative), BFGS (unconstrained, gradient based),
Newton-CG(unconstrained, gradient), SLSQP(constrained), ….
• Jac, hess: Jacobian and heasein of the objective function
• bounds: bounds on the search space
• constr: Constraints on the objective functions
• args: To pass values to the objective function
• options: method specific options
Reference: scipy.optimize.minimize documentation
scipy.optimize.minimize(fun, x0, args=(), method=None, jac=None,
hess=None, bounds=None, constraints=(), options=None)
• fun: The objective function
• X0: The initial value
• method: Nelder-Mead(unconstrained, no derivative), Powell
(unconstrained, no derivative), BFGS (unconstrained, gradient based),
Newton-CG(unconstrained, gradient), SLSQP(constrained), ….
• Jac, hess: Jacobian and heasein of the objective function
• bounds: bounds on the search space
• constr: Constraints on the objective functions
• args: To pass values to the objective function
• options: method specific options
Reference: scipy.optimize.minimize documentation
From P-Q
relationship
Profit
Introduction to Price Optimisation
Price Quantity
Product-1 18.5 2.58
Product-2 16.82 22.7
Product-3 11.19 30.42
Total 55.7
Profit 338
Proposed Prices and Quantities
Price Quantity
Product-1 15.67 3.6
Product-2 13.73 24.68
Product-3 13.95 22.29
Total 50.56
Profit 253
Last Week Prices and Quantities
• Stochastic Gradient Optimization
• Bayesian optimization​
• ADAM optimization​
• Evolutionary strategies​
• Enforcement learning​
• ……….
Questions and Answers

More Related Content

PDF
Machine Learning: Applications, Process and Techniques
PPT
Artificial bee colony (abc)
PPTX
Automated Machine Learning
PPTX
Predict Breast Cancer using Deep Learning
PDF
Depth Fusion from RGB and Depth Sensors by Deep Learning
PPTX
Explainable Machine Learning (Explainable ML)
PPTX
Genetic algorithm raktim
PPTX
Swarm intelligence
Machine Learning: Applications, Process and Techniques
Artificial bee colony (abc)
Automated Machine Learning
Predict Breast Cancer using Deep Learning
Depth Fusion from RGB and Depth Sensors by Deep Learning
Explainable Machine Learning (Explainable ML)
Genetic algorithm raktim
Swarm intelligence

What's hot (20)

PDF
Foundation of Machine Learning
PDF
Mask-RCNN for Instance Segmentation
PPTX
Genetic Algorithm
PDF
Machine learning vs deep learning
PDF
Optimization for Deep Learning
PDF
Generative adversarial networks
PPS
Bio Inspired Computing Final Version
PPTX
Breast cancer Detection using MATLAB
PPTX
Basics of digital image processing
PDF
PR-207: YOLOv3: An Incremental Improvement
PDF
Parametric & Non-Parametric Machine Learning (Supervised ML)
PPTX
Machine learning ppt
PDF
ML Basics
PPTX
Automated Machine Learning (Auto ML)
PDF
Machine learning
PDF
Introduction to Computer Vision.pdf
PPTX
Machine Learning
PDF
Lec1: Medical Image Computing - Introduction
PPTX
Machine learning applications nurturing growth of various business domains
PPTX
Current status of ai (social and professional position)
Foundation of Machine Learning
Mask-RCNN for Instance Segmentation
Genetic Algorithm
Machine learning vs deep learning
Optimization for Deep Learning
Generative adversarial networks
Bio Inspired Computing Final Version
Breast cancer Detection using MATLAB
Basics of digital image processing
PR-207: YOLOv3: An Incremental Improvement
Parametric & Non-Parametric Machine Learning (Supervised ML)
Machine learning ppt
ML Basics
Automated Machine Learning (Auto ML)
Machine learning
Introduction to Computer Vision.pdf
Machine Learning
Lec1: Medical Image Computing - Introduction
Machine learning applications nurturing growth of various business domains
Current status of ai (social and professional position)
Ad

Similar to Introduction to Price Optimisation (20)

PDF
Python: ottimizzazione numerica algoritmi genetici
PDF
Artificial Intelligence Course: Linear models
PDF
Derivative free optimizations
PDF
Deploying Data Science for Distribution of The New York Times - Anne Bauer
PPTX
slides.pptx
PDF
VET4SBO Level 2 module 2 - unit 1 - v1.0 en
PPTX
OR Ndejje Univ (1).pptx
PPTX
OR Ndejje Univ.pptx
PDF
Ensemble Methods and Recommender Systems
PDF
Pragmatic Machine Learning @ ML Spain
PPT
Utah Code Camp 2014 - Learning from Data by Thomas Holloway
PPTX
Linear Programing.pptx
PPTX
Introduction to mathematical optimization
PPT
Machine learning introduction to unit 1.ppt
PDF
Facebook Talk at Netflix ML Platform meetup Sep 2019
PDF
DS M1 full - KQB KtuQbank.pdf
PPTX
Optimization Using Evolutionary Computing Techniques
PPTX
1_Introduction.pptx
PPT
Lecture: introduction to Machine Learning.ppt
PPTX
Regression ppt
Python: ottimizzazione numerica algoritmi genetici
Artificial Intelligence Course: Linear models
Derivative free optimizations
Deploying Data Science for Distribution of The New York Times - Anne Bauer
slides.pptx
VET4SBO Level 2 module 2 - unit 1 - v1.0 en
OR Ndejje Univ (1).pptx
OR Ndejje Univ.pptx
Ensemble Methods and Recommender Systems
Pragmatic Machine Learning @ ML Spain
Utah Code Camp 2014 - Learning from Data by Thomas Holloway
Linear Programing.pptx
Introduction to mathematical optimization
Machine learning introduction to unit 1.ppt
Facebook Talk at Netflix ML Platform meetup Sep 2019
DS M1 full - KQB KtuQbank.pdf
Optimization Using Evolutionary Computing Techniques
1_Introduction.pptx
Lecture: introduction to Machine Learning.ppt
Regression ppt
Ad

Recently uploaded (20)

PDF
Microsoft 365 products and services descrption
PPT
DU, AIS, Big Data and Data Analytics.ppt
DOCX
Factor Analysis Word Document Presentation
PPTX
Phase1_final PPTuwhefoegfohwfoiehfoegg.pptx
PPTX
IMPACT OF LANDSLIDE.....................
PDF
A biomechanical Functional analysis of the masitary muscles in man
PPTX
Crypto_Trading_Beginners.pptxxxxxxxxxxxxxx
PDF
Tetra Pak Index 2023 - The future of health and nutrition - Full report.pdf
PPT
statistics analysis - topic 3 - describing data visually
PPTX
1 hour to get there before the game is done so you don’t need a car seat for ...
PPTX
statsppt this is statistics ppt for giving knowledge about this topic
PPTX
Caseware_IDEA_Detailed_Presentation.pptx
PDF
Session 11 - Data Visualization Storytelling (2).pdf
PDF
CS3352FOUNDATION OF DATA SCIENCE _1_MAterial.pdf
PPTX
Copy of 16 Timeline & Flowchart Templates – HubSpot.pptx
PPTX
Business_Capability_Map_Collection__pptx
PDF
©️ 02_SKU Automatic SW Robotics for Microsoft PC.pdf
PPTX
New ISO 27001_2022 standard and the changes
PPTX
DS-40-Pre-Engagement and Kickoff deck - v8.0.pptx
PPTX
MBA JAPAN: 2025 the University of Waseda
Microsoft 365 products and services descrption
DU, AIS, Big Data and Data Analytics.ppt
Factor Analysis Word Document Presentation
Phase1_final PPTuwhefoegfohwfoiehfoegg.pptx
IMPACT OF LANDSLIDE.....................
A biomechanical Functional analysis of the masitary muscles in man
Crypto_Trading_Beginners.pptxxxxxxxxxxxxxx
Tetra Pak Index 2023 - The future of health and nutrition - Full report.pdf
statistics analysis - topic 3 - describing data visually
1 hour to get there before the game is done so you don’t need a car seat for ...
statsppt this is statistics ppt for giving knowledge about this topic
Caseware_IDEA_Detailed_Presentation.pptx
Session 11 - Data Visualization Storytelling (2).pdf
CS3352FOUNDATION OF DATA SCIENCE _1_MAterial.pdf
Copy of 16 Timeline & Flowchart Templates – HubSpot.pptx
Business_Capability_Map_Collection__pptx
©️ 02_SKU Automatic SW Robotics for Microsoft PC.pdf
New ISO 27001_2022 standard and the changes
DS-40-Pre-Engagement and Kickoff deck - v8.0.pptx
MBA JAPAN: 2025 the University of Waseda

Introduction to Price Optimisation

  • 1. Price Optimisation with Python Ammar Mohemmed 21/07/2019
  • 2. • In 1985, American Airlines was threatened on its core routes by the low-fare carrier PeopleExpress. In response, American developed an optimisation algorithm to set the prices dynamically • In 2012, the travel site Orbitz was found to be adjusting its prices for users of Apple Mac computers • The Wall Street Journal revealed that the Staples website offered products at different prices depending on the user’s proximity to rival stores
  • 3. • Using data to adjust prices in order to achieve maximum revenue or profit • Price change period from a year to minutes • Single product or multiple products • Considering the substitute from own company and competitors • Considering the laddering (same product but different size or weight or count) • New products with not enough data • Considering other business constraints
  • 4. • Demand: Quantity sold, number of vehicles, no. of passengers … • Law of demand: that other factors being constant (cetris peribus), price and quantity demand of any good and service are inversely related to each other. When the price of a product increases, the demand for the same product will fall. • How to extract possible cofounding variables. • Linear, polynomial or exponential relationship is fitted.
  • 5. Estimate the demand vs price relationship Maximize the revenue by optimization Q = b0 + b1 * P R = (b0 + b1 * P) * P Linear, polynomial or exponential relationship is fitted.
  • 6. • Is a phenomenon in probability and statistics, in which a trend appears in several different groups of data but disappears or reverses when these groups are combined (Wikipedia)
  • 7. Quantity increases with price, but difference of quantity decreases Quantity Quantity vs. price Quantity difference vs. price Quantity difference
  • 8. Objective function: Profit – Q1*(P1-C1) + Q2*(P2-C2) + Q3*(P3-C3) • Variables: P1, P2, P3 • Constraints:  Product-2 price higher than Product-3 by 1  Product-1 higher than its cost by 0.5  Product-1 higher than product-2 by 1.7 • Bounds:  Max price: 50  Min price: product cost
  • 9. • Not considering cross-relationship
  • 10. Any optimization problem has three components: 1. Decision variables 2. The objective function 3. Constraints General Optimisation Problem: • Very difficult to solve • Longer computation time, not always finding the solution • Heuristic optimization methods Exception: • Least square problems • Linear programming problems • Convex optimisation Business Problem Mathematical Model (python) Solution Modeling Algorithm Interpretation minimize f0(x) subject to: fi(x) <= 0 hi(x) = 0 X = (X0, X1, X2 … Xn) F0(x), Rn  R objective function hi(x), Rn  R, i = 1, …, m, constraint function
  • 12. • Derivative: Measures the sensitivity to change of the function value (output value) with respect to a change in it’s argument (input value). • Gradient: is a multi-variable generalization of the derivative. Points in the direction of greatest increase of a function. • Jacobian matrix: The first derivative of a vector-values function. • Hessian matrix: is a square matrix of second-order partial derivative of a scalar-valued function.
  • 13. • scipy.optimize: Minimization of scalar function of one or more variables Linear and Non-linear constraints • CVXPY: Python-embedded modelling language for convex optimization problems similar to CVX matlab • Pyomo: It has it’s own language • pyOpt: Nonlinear constrained optimization problems • PuLP: It is used to describe optimization problems as mathematical models • Google Optimisation Tools: For solving combinatorial optimization problems • Noisyopt,
  • 14. • Derivative based methods o It needs to find the derivative of the objective function in away or another • Non-derivative based methods o It does not need to find the derivative o Based on the evaluation of the objective function, it will be slower • Constraints or non-constraints methods • Linear or Non-linear objective functions • Stochastic and evolutionary based methods
  • 15. scipy.optimize.minimize(fun, x0, args=(), method=None, jac=None, hess=None, bounds=None, constraints=(), options=None) • fun: The objective function • X0: The initial value • method: Nelder-Mead(unconstrained, no derivative), Powell (unconstrained, no derivative), BFGS (unconstrained, gradient based), Newton-CG(unconstrained, gradient), SLSQP(constrained), …. • Jac, hess: Jacobian and heasein of the objective function • bounds: bounds on the search space • constr: Constraints on the objective functions • args: To pass values to the objective function • options: method specific options Reference: scipy.optimize.minimize documentation scipy.optimize.minimize(fun, x0, args=(), method=None, jac=None, hess=None, bounds=None, constraints=(), options=None) • fun: The objective function • X0: The initial value • method: Nelder-Mead(unconstrained, no derivative), Powell (unconstrained, no derivative), BFGS (unconstrained, gradient based), Newton-CG(unconstrained, gradient), SLSQP(constrained), …. • Jac, hess: Jacobian and heasein of the objective function • bounds: bounds on the search space • constr: Constraints on the objective functions • args: To pass values to the objective function • options: method specific options Reference: scipy.optimize.minimize documentation
  • 18. Price Quantity Product-1 18.5 2.58 Product-2 16.82 22.7 Product-3 11.19 30.42 Total 55.7 Profit 338 Proposed Prices and Quantities Price Quantity Product-1 15.67 3.6 Product-2 13.73 24.68 Product-3 13.95 22.29 Total 50.56 Profit 253 Last Week Prices and Quantities
  • 19. • Stochastic Gradient Optimization • Bayesian optimization​ • ADAM optimization​ • Evolutionary strategies​ • Enforcement learning​ • ……….