SlideShare une entreprise Scribd logo
1  sur  15
Télécharger pour lire hors ligne
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

Contenu connexe

Dernier

University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall 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
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
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
 
(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
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
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
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
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
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 

Dernier (20)

University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
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
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
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
 
(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...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
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
 
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
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
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...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 

En vedette

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
 

En vedette (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