SlideShare a Scribd company logo
1 of 15
Download to read offline
NOVEMBER 29, 2019
USING PULP AND SOLVERS FOR BUSINESS ANALYTICS
At MOKA, we build intelligent planning software that allows
organizations to make smarter, faster, strategic decisions.
The Winning Model powers strategic planning for manufacturing business models – from CPG to automotive to industrials.
Ready to go out-of-the box, we tailor the core modules and intelligence engine to a client’s specific business.
Unifies strategic data model,
automates & speeds analysis,
and addresses data gaps
Delivers a lasting organizational
capability. Enterprise-ready, secure &
light-weight for fast deployment
Encode and distribute high-quality
strategy frameworks across your
entire organization
Predictive & prescriptive
analytics drive insights &
evaluate complex scenarios
Descriptive
Analytics
Diagnostic
Analytics
Predictive
Analytics
Prescriptive
Analytics
What happened?
Why did it happen?
What will happen?
How can we make it happen?
INFORMATION
OPTIMIZATION
HINDSIGHT
INSIGHT
FORESIGHT
Value
Difficulty
Source: Gartner
BUSINESS ANALYTICS VALUE LADDER
4
Talk Outline
1
What is Linear
Programming?
2
Using PuLP for Macro
Capacity Planning
3
Python Solver
Landscape
4
Best Practices for Using
Solvers for Analytics
3/31/2017
LINEAR PROGRAMMING
Matrix Form Standard Form
! "#, "%, … = (#"# + (%"% + ⋯
+##"# + +#%"% + ⋯ ≤ -#
+%#"# + +%%"% + ⋯ ≤ -%
+.#"# + +.%"% + ⋯ ≤ -.
…
"# ≥ 0
"% ≥ 0
…
12
3
43 ≤ 5
3 ≥ 6
minimize
subject to
and
Trick #1: negate all the constants to
maximize a function
Trick #2: re-arrange expressions
(e.g., subtract from both sides) to
isolate constant on the right side
Trick #3: add slack/dummy
variables to encode other
relationships, e.g., strict equality
Many tools, including PuLP, can apply
these tricks automatically to allow a
more natural expression
MACRO CAPACITY PLANNING:
BUSINESS QUESTIONS
• Where are the inefficiencies in our supply chain?
• Will we have enough production capacity if
demand grows?
• Is our supply chain positioned to profitably
capture growth opportunities?
• Should we open a new warehouse and/or factory?
If so, where?
With the Winning Model’s Network Strategy Module, Network Planners and CEOs
can evaluate network strategy and investment opportunities instantaneously
3/31/2017
Jupyter Walkthrough
https://github.com/moka-analytics/engineering
Paradigm1 Problem Form Example Use Cases Example Python Packages
Mathematical/Numerical
Linear Programming • Supply chain optimization
• Production planning
• PuLP: interface to linear and mixed-integer solvers
• MIPCL: commercial mixed-integer programming
• GLOP: Google’s LP-only solver
Integer Programming • Minimize interference across
cellular network
• Bus scheduling/Vehicle routing
• “Knapsack” problem
Quadratic Programming • Financial portfolio optimization
• Image/signals processing
• Least-Squares regression
• qpsolvers: unified interface around quadratic solvers
• quadprog: implementation of the Goldfarb/Idnani dual algorithm
Convex Optimization • Training ML models
• Linear/Quadratic are a special
case of Convex
• cvxpy
• cvxopt
Non-Linear Programming • pyOpt
Multi-Paradigm • Pyomo: multi-paradigm interface to multiple solvers
• Google OR-Tools: Google’s operations research tools
• Gurobi: commercial optimizer supporting multiple languages
• SciPy: its optimize package contains numerous solvers
Logical/Constraint
Logic Programming
P(x).
?- Q(x).
• Expert system AI
• Knowledge graph inference
• Natural Language Processing
(NLP)
• logpy (aka kanren)
• PySWIP: SWI-Prolog bridge
• ErgoAI: via a Java bridge
• Pyke: pure Python
Satisfiability Modulo
Theories (SMT)
• Static software analysis
• Program synthesis
• Scheduling
• pySMT: interface to SMT-LIB format supporting all major solvers
• Z3: Microsoft’s SMT solver with support for multiple
• CP-SAT: Google’s constraint programming solver
PYTHON SOLVER LANDSCAPE 1
Not all paradigms shown. Wikipedia is a good resource for exploring various paradigms
∃". $(")
3/31/2017
BEST PRACTICES FOR USING SOLVERS FOR ANALYTICS
Avoid false precision
Support user intuition with
analytics and visualizations
Know when to tradeoff speed
vs. precision
Benchmark optimizers to find
best for your workload
Get creative with elastic
computing resources
Educate users about what’s being
optimized, e.g., assumptions and
limitations
Profile your Python problem
creation code
Don’t be afraid to run a solver
multiple times
KEY TAKEAWAYS
• Important business problems can be
framed as optimization problems
• There’s a Python interface for every
kind of problem
• Augment solver output with
complementary analyses and
visualizations
We’re Hiring!
• Senior Full Stack Engineer
• Senior Front-End Engineer
• Data Integration Engineer
• Vice President, Deployment Strategy
• Business Project Manager
Come find me after the talk, or email me at todd@moka.nyc
We offer $$$ for successful referrals
Slides and notebook available on GitHub:
https://github.com/moka-analytics/engineering
Find more of my talks and articles at
https://toddschiller.com/
Learn more about MOKA Analytics at
https://www.moka.nyc
3/31/2017
Appendix
3/31/2017
THREE PYTHON SOLVER ARCHITECTURES
Python Library/DSL
Python
Python Library/DSL
Python
C Extension
Pure Python Python w/ C
Python Library/DSL
Python
Standard Representation
Subprocess
Python w/ External
Executable
DSL = Domain Specific Language
Can easily swap solvers. But pay a
speed penalty for (de)serialization
3/31/2017
TACTICS FOR SUPPORTING INTUITION BEHIND OPTIMIZATION RESULTS
Leverage existing descriptive
and diagnostic analytics
Show “diff” of output as user
tweaks assumptions
Show local trade-offsFocus on major drivers /
points of sensitivity

More Related Content

Recently uploaded

KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 

Recently uploaded (20)

KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Using PuLP and optimization in business analytics

  • 1. NOVEMBER 29, 2019 USING PULP AND SOLVERS FOR BUSINESS ANALYTICS
  • 2. At MOKA, we build intelligent planning software that allows organizations to make smarter, faster, strategic decisions. The Winning Model powers strategic planning for manufacturing business models – from CPG to automotive to industrials. Ready to go out-of-the box, we tailor the core modules and intelligence engine to a client’s specific business. Unifies strategic data model, automates & speeds analysis, and addresses data gaps Delivers a lasting organizational capability. Enterprise-ready, secure & light-weight for fast deployment Encode and distribute high-quality strategy frameworks across your entire organization Predictive & prescriptive analytics drive insights & evaluate complex scenarios
  • 3. Descriptive Analytics Diagnostic Analytics Predictive Analytics Prescriptive Analytics What happened? Why did it happen? What will happen? How can we make it happen? INFORMATION OPTIMIZATION HINDSIGHT INSIGHT FORESIGHT Value Difficulty Source: Gartner BUSINESS ANALYTICS VALUE LADDER
  • 4. 4 Talk Outline 1 What is Linear Programming? 2 Using PuLP for Macro Capacity Planning 3 Python Solver Landscape 4 Best Practices for Using Solvers for Analytics
  • 5. 3/31/2017 LINEAR PROGRAMMING Matrix Form Standard Form ! "#, "%, … = (#"# + (%"% + ⋯ +##"# + +#%"% + ⋯ ≤ -# +%#"# + +%%"% + ⋯ ≤ -% +.#"# + +.%"% + ⋯ ≤ -. … "# ≥ 0 "% ≥ 0 … 12 3 43 ≤ 5 3 ≥ 6 minimize subject to and Trick #1: negate all the constants to maximize a function Trick #2: re-arrange expressions (e.g., subtract from both sides) to isolate constant on the right side Trick #3: add slack/dummy variables to encode other relationships, e.g., strict equality Many tools, including PuLP, can apply these tricks automatically to allow a more natural expression
  • 6. MACRO CAPACITY PLANNING: BUSINESS QUESTIONS • Where are the inefficiencies in our supply chain? • Will we have enough production capacity if demand grows? • Is our supply chain positioned to profitably capture growth opportunities? • Should we open a new warehouse and/or factory? If so, where?
  • 7. With the Winning Model’s Network Strategy Module, Network Planners and CEOs can evaluate network strategy and investment opportunities instantaneously
  • 9. Paradigm1 Problem Form Example Use Cases Example Python Packages Mathematical/Numerical Linear Programming • Supply chain optimization • Production planning • PuLP: interface to linear and mixed-integer solvers • MIPCL: commercial mixed-integer programming • GLOP: Google’s LP-only solver Integer Programming • Minimize interference across cellular network • Bus scheduling/Vehicle routing • “Knapsack” problem Quadratic Programming • Financial portfolio optimization • Image/signals processing • Least-Squares regression • qpsolvers: unified interface around quadratic solvers • quadprog: implementation of the Goldfarb/Idnani dual algorithm Convex Optimization • Training ML models • Linear/Quadratic are a special case of Convex • cvxpy • cvxopt Non-Linear Programming • pyOpt Multi-Paradigm • Pyomo: multi-paradigm interface to multiple solvers • Google OR-Tools: Google’s operations research tools • Gurobi: commercial optimizer supporting multiple languages • SciPy: its optimize package contains numerous solvers Logical/Constraint Logic Programming P(x). ?- Q(x). • Expert system AI • Knowledge graph inference • Natural Language Processing (NLP) • logpy (aka kanren) • PySWIP: SWI-Prolog bridge • ErgoAI: via a Java bridge • Pyke: pure Python Satisfiability Modulo Theories (SMT) • Static software analysis • Program synthesis • Scheduling • pySMT: interface to SMT-LIB format supporting all major solvers • Z3: Microsoft’s SMT solver with support for multiple • CP-SAT: Google’s constraint programming solver PYTHON SOLVER LANDSCAPE 1 Not all paradigms shown. Wikipedia is a good resource for exploring various paradigms ∃". $(")
  • 10. 3/31/2017 BEST PRACTICES FOR USING SOLVERS FOR ANALYTICS Avoid false precision Support user intuition with analytics and visualizations Know when to tradeoff speed vs. precision Benchmark optimizers to find best for your workload Get creative with elastic computing resources Educate users about what’s being optimized, e.g., assumptions and limitations Profile your Python problem creation code Don’t be afraid to run a solver multiple times
  • 11. KEY TAKEAWAYS • Important business problems can be framed as optimization problems • There’s a Python interface for every kind of problem • Augment solver output with complementary analyses and visualizations
  • 12. We’re Hiring! • Senior Full Stack Engineer • Senior Front-End Engineer • Data Integration Engineer • Vice President, Deployment Strategy • Business Project Manager Come find me after the talk, or email me at todd@moka.nyc We offer $$$ for successful referrals Slides and notebook available on GitHub: https://github.com/moka-analytics/engineering Find more of my talks and articles at https://toddschiller.com/ Learn more about MOKA Analytics at https://www.moka.nyc
  • 14. 3/31/2017 THREE PYTHON SOLVER ARCHITECTURES Python Library/DSL Python Python Library/DSL Python C Extension Pure Python Python w/ C Python Library/DSL Python Standard Representation Subprocess Python w/ External Executable DSL = Domain Specific Language Can easily swap solvers. But pay a speed penalty for (de)serialization
  • 15. 3/31/2017 TACTICS FOR SUPPORTING INTUITION BEHIND OPTIMIZATION RESULTS Leverage existing descriptive and diagnostic analytics Show “diff” of output as user tweaks assumptions Show local trade-offsFocus on major drivers / points of sensitivity