SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Downloaden Sie, um offline zu lesen
Model Optimization with Competing Objectives
QuantCon 2018
Scott Clark
scott@sigopt.com
OUTLINE
1. Why is Tuning Models Hard?
2. Common Tuning Methods
3. Deep Learning Example
4. Tuning Multiple Metrics
5. Multi-metric Optimization Examples
Algorithmic Trading and AI / ML are
extremely powerful
Tuning these systems is
extremely non-intuitive
Photo: Joe Ross
TUNABLE PARAMETERS IN DEEP LEARNING
TUNABLE PARAMETERS IN DEEP LEARNING
TUNABLE PARAMETERS IN DEEP LEARNING
TUNABLE PARAMETERS IN DEEP LEARNING
TUNABLE PARAMETERS IN DEEP LEARNING
Photo: Tammy
Strobel
STANDARD METHODS
FOR PARAMETER SEARCH
STANDARD TUNING METHODS
Trading
Models
Data
Backtest /
Simulation
Parameter
Configuration
?
Grid Search Random Search
Manual Search
- Weights
- Thresholds
- Window sizes
- Transformations
Domain
Expertise
OPTIMIZATION FEEDBACK LOOP
Objective Metric
Better
Results
REST API
New configurations
Trading
Models
Data
Backtest /
Simulation
Domain
Expertise
● Create a strategy to trade Select Sector SPDR ETFs
○ XLV, XLF, XLP, XLE, XLK, XLB, XLU, XLI
● Trade on common signals
○ Relative Strength Interest (RSI)
○ Rate of Change (ROC)
● Maximize Sharpe Ratio
PROBLEM
https://blog.quantopian.com/bayesian-optimization-of-a-technical-trading-algorithm-with-ziplinesigopt-2/
TUNABLE PARAMETERS IN ALGO TRADING
● Relative Strength Interest (RSI)
○ Lookback window for # of prices used in the RSI calculation
○ Lower_bound value defining the trade entry condition
○ Range_width, which will be added to the Lower-bound
■ Lower_bound + Range_width is the range of values over which our RSI signal will be
considered True
● Rate of Change (ROC)
○ Lookback window for # of prices used in the ROC calculation
○ Lower_bound value defining the trade entry condition
○ Range_width, which will be added to the Lower-bound
■ Lower_bound + Range_width is the range of values over which our ROC signal will be
considered True
● Signal evaluation frequency
○ Number of days between evaluation of if our signals
■ Do we evaluate them every day, every week, every month, etc.
COMBINATORIAL EXPLOSION
● RSI lookback window: 115 values (5 to 120)
● RSI lower bound: 90 values (0 to 90)
● RSI range width: 20 values (10 to 30)
● ROC lookback window: 61 values (2 to 63)
● ROC lower bound: 30 values (0 to 30)
● ROC range width: 195 values (5 to 200)
● Evaluation frequency: 18 values (3 to 21)
=
1,329,623,100,000 possible configurations
COMPARATIVE PERFORMANCE
Grid Search
Expert
Grid
● Better: 200%
Higher model
returns than
manual search
● Faster/Cheaper:
10x fewer
evaluations
vs standard
methods
BacktestPortfolioValue
Time (2004-2012)
Blog Post
COMPARATIVE PERFORMANCE
https://papers.ssrn.com/sol3/paper
s.cfm?abstract_id=2745220
● Out of sample
performance is
terrible
● We need better
metrics
TUNING MULTIPLE METRICS
What if we want to optimize multiple competing metrics?
● Trading Tradeoffs
○ Sharpe Ratio vs Drawdown
○ Backtest Alpha vs Uncertainty
○ Quality vs Robustness
● Complexity Tradeoffs
○ Accuracy vs Training Time
○ Accuracy vs Inference Time
PARETO OPTIMAL
What does it mean to optimize two metrics simultaneously?
Pareto efficiency or Pareto optimality is a state of
allocation of resources from which it is impossible to
reallocate so as to make any one individual or
preference criterion better off without making at least
one individual or preference criterion worse off.
PARETO OPTIMAL
What does it mean to optimize two metrics simultaneously?
The red points are on the Pareto
Efficient Frontier, they strictly
dominate all of the grey points.
You can do no better in one metric
without sacrificing performance in
the other.
Point N is Pareto Optimal
compared to Point K.
PARETO EFFICIENT FRONTIER
Goal is to have best set of feasible solutions to select from
After optimization the expert picks
one or more of the red points from
the Pareto Efficient Frontier to
further study or put into production.
TOY EXAMPLE
MULTI-METRIC OPTIMIZATION
DEEP LEARNING EXAMPLES
MULTI-METRIC OPT IN DEEP LEARNING
https://devblogs.nvidia.com/sigopt-deep-learning-hyperparameter-optimization/
DEEP LEARNING TRADEOFFS
● Deep Learning pipelines are time
consuming and expensive to run
● Application and deployment
conditions may make certain
configurations less desirable
● Tuning for both accuracy and
complexity metrics like training or
inference time allows expert to make
best decision for production
● Comparison of several RMSProp SGD parametrizations
● Different configurations converge differently
STOCHASTIC GRADIENT DESCENT
TEXT CLASSIFICATION PIPELINE
ML / AI
Model
(MXNet)
Testing
Text
Validation
Accuracy
Better
Results
REST API
Hyperparameter
Configurations
and
Feature
Transformations
Training
Text
Training Time
FINDING THE FRONTIER
SEQUENCE CLASSIFICATION PIPELINE
ML / AI
Model
(Tensorflow)
Testing
Sequences
Validation
Accuracy
Better
Results
REST API
Hyperparameter
Configurations
and
Feature
Transformations
Training
Sequences
Inference Time
TEXT CLASSIFICATION PIPELINE
FINDING THE FRONTIER
FINDING THE FRONTIER
LOAN CLASSIFICATION PIPELINE
ML / AI
Model
(LightGBM)
Testing
Data
Validation
AUCPR
Better
Results
REST API
Hyperparameter
Configurations
and
Feature
Transformations
Training
Data
Avg $ Lost
GRID SEARCH CAN MISLEAD
● Best grid search point (wrt
accuracy) loses >$35 /
transaction
● Best grid search point (wrt loss)
has 70% accuracy
● Points of the Pareto Frontier give
user more information about
what is possible and more
control of trade-offs
TAKEAWAYS
One metric may not paint the whole picture
- Think about metric trade-offs in your model pipelines
- Optimizing for the wrong thing can be very expensive
Not all optimization strategies are equal
- Pick an optimization strategy that gives the most flexibility
- Different tools enable you to tackle new problems
Questions?
contact@sigopt.com
https://sigopt.com
@SigOpt

Weitere ähnliche Inhalte

Mehr von SigOpt

Tuning Data Augmentation to Boost Model Performance
Tuning Data Augmentation to Boost Model PerformanceTuning Data Augmentation to Boost Model Performance
Tuning Data Augmentation to Boost Model PerformanceSigOpt
 
Advanced Optimization for the Enterprise Webinar
Advanced Optimization for the Enterprise WebinarAdvanced Optimization for the Enterprise Webinar
Advanced Optimization for the Enterprise WebinarSigOpt
 
Modeling at Scale: SigOpt at TWIMLcon 2019
Modeling at Scale: SigOpt at TWIMLcon 2019Modeling at Scale: SigOpt at TWIMLcon 2019
Modeling at Scale: SigOpt at TWIMLcon 2019SigOpt
 
Tuning 2.0: Advanced Optimization Techniques Webinar
Tuning 2.0: Advanced Optimization Techniques WebinarTuning 2.0: Advanced Optimization Techniques Webinar
Tuning 2.0: Advanced Optimization Techniques WebinarSigOpt
 
SigOpt at Ai4 Finance—Modeling at Scale
SigOpt at Ai4 Finance—Modeling at Scale SigOpt at Ai4 Finance—Modeling at Scale
SigOpt at Ai4 Finance—Modeling at Scale SigOpt
 
Interactive Tradeoffs Between Competing Offline Metrics with Bayesian Optimiz...
Interactive Tradeoffs Between Competing Offline Metrics with Bayesian Optimiz...Interactive Tradeoffs Between Competing Offline Metrics with Bayesian Optimiz...
Interactive Tradeoffs Between Competing Offline Metrics with Bayesian Optimiz...SigOpt
 
Machine Learning Infrastructure
Machine Learning InfrastructureMachine Learning Infrastructure
Machine Learning InfrastructureSigOpt
 
SigOpt at Uber Science Symposium - Exploring the spectrum of black-box optimi...
SigOpt at Uber Science Symposium - Exploring the spectrum of black-box optimi...SigOpt at Uber Science Symposium - Exploring the spectrum of black-box optimi...
SigOpt at Uber Science Symposium - Exploring the spectrum of black-box optimi...SigOpt
 
SigOpt at O'Reilly - Best Practices for Scaling Modeling Platforms
SigOpt at O'Reilly - Best Practices for Scaling Modeling PlatformsSigOpt at O'Reilly - Best Practices for Scaling Modeling Platforms
SigOpt at O'Reilly - Best Practices for Scaling Modeling PlatformsSigOpt
 
SigOpt at GTC - Tuning the Untunable
SigOpt at GTC - Tuning the UntunableSigOpt at GTC - Tuning the Untunable
SigOpt at GTC - Tuning the UntunableSigOpt
 
SigOpt at GTC - Reducing operational barriers to optimization
SigOpt at GTC - Reducing operational barriers to optimizationSigOpt at GTC - Reducing operational barriers to optimization
SigOpt at GTC - Reducing operational barriers to optimizationSigOpt
 
Lessons for an enterprise approach to modeling at scale
Lessons for an enterprise approach to modeling at scaleLessons for an enterprise approach to modeling at scale
Lessons for an enterprise approach to modeling at scaleSigOpt
 
Modeling at scale in systematic trading
Modeling at scale in systematic tradingModeling at scale in systematic trading
Modeling at scale in systematic tradingSigOpt
 
SigOpt at MLconf - Reducing Operational Barriers to Model Training
SigOpt at MLconf - Reducing Operational Barriers to Model TrainingSigOpt at MLconf - Reducing Operational Barriers to Model Training
SigOpt at MLconf - Reducing Operational Barriers to Model TrainingSigOpt
 
Machine Learning Infrastructure
Machine Learning InfrastructureMachine Learning Infrastructure
Machine Learning InfrastructureSigOpt
 
Tuning the Untunable - Insights on Deep Learning Optimization
Tuning the Untunable - Insights on Deep Learning OptimizationTuning the Untunable - Insights on Deep Learning Optimization
Tuning the Untunable - Insights on Deep Learning OptimizationSigOpt
 
Machine Learning Fundamentals
Machine Learning FundamentalsMachine Learning Fundamentals
Machine Learning FundamentalsSigOpt
 
Tips and techniques for hyperparameter optimization
Tips and techniques for hyperparameter optimizationTips and techniques for hyperparameter optimization
Tips and techniques for hyperparameter optimizationSigOpt
 
MLconf 2017 Seattle Lunch Talk - Using Optimal Learning to tune Deep Learning...
MLconf 2017 Seattle Lunch Talk - Using Optimal Learning to tune Deep Learning...MLconf 2017 Seattle Lunch Talk - Using Optimal Learning to tune Deep Learning...
MLconf 2017 Seattle Lunch Talk - Using Optimal Learning to tune Deep Learning...SigOpt
 
Using Optimal Learning to Tune Deep Learning Pipelines
Using Optimal Learning to Tune Deep Learning PipelinesUsing Optimal Learning to Tune Deep Learning Pipelines
Using Optimal Learning to Tune Deep Learning PipelinesSigOpt
 

Mehr von SigOpt (20)

Tuning Data Augmentation to Boost Model Performance
Tuning Data Augmentation to Boost Model PerformanceTuning Data Augmentation to Boost Model Performance
Tuning Data Augmentation to Boost Model Performance
 
Advanced Optimization for the Enterprise Webinar
Advanced Optimization for the Enterprise WebinarAdvanced Optimization for the Enterprise Webinar
Advanced Optimization for the Enterprise Webinar
 
Modeling at Scale: SigOpt at TWIMLcon 2019
Modeling at Scale: SigOpt at TWIMLcon 2019Modeling at Scale: SigOpt at TWIMLcon 2019
Modeling at Scale: SigOpt at TWIMLcon 2019
 
Tuning 2.0: Advanced Optimization Techniques Webinar
Tuning 2.0: Advanced Optimization Techniques WebinarTuning 2.0: Advanced Optimization Techniques Webinar
Tuning 2.0: Advanced Optimization Techniques Webinar
 
SigOpt at Ai4 Finance—Modeling at Scale
SigOpt at Ai4 Finance—Modeling at Scale SigOpt at Ai4 Finance—Modeling at Scale
SigOpt at Ai4 Finance—Modeling at Scale
 
Interactive Tradeoffs Between Competing Offline Metrics with Bayesian Optimiz...
Interactive Tradeoffs Between Competing Offline Metrics with Bayesian Optimiz...Interactive Tradeoffs Between Competing Offline Metrics with Bayesian Optimiz...
Interactive Tradeoffs Between Competing Offline Metrics with Bayesian Optimiz...
 
Machine Learning Infrastructure
Machine Learning InfrastructureMachine Learning Infrastructure
Machine Learning Infrastructure
 
SigOpt at Uber Science Symposium - Exploring the spectrum of black-box optimi...
SigOpt at Uber Science Symposium - Exploring the spectrum of black-box optimi...SigOpt at Uber Science Symposium - Exploring the spectrum of black-box optimi...
SigOpt at Uber Science Symposium - Exploring the spectrum of black-box optimi...
 
SigOpt at O'Reilly - Best Practices for Scaling Modeling Platforms
SigOpt at O'Reilly - Best Practices for Scaling Modeling PlatformsSigOpt at O'Reilly - Best Practices for Scaling Modeling Platforms
SigOpt at O'Reilly - Best Practices for Scaling Modeling Platforms
 
SigOpt at GTC - Tuning the Untunable
SigOpt at GTC - Tuning the UntunableSigOpt at GTC - Tuning the Untunable
SigOpt at GTC - Tuning the Untunable
 
SigOpt at GTC - Reducing operational barriers to optimization
SigOpt at GTC - Reducing operational barriers to optimizationSigOpt at GTC - Reducing operational barriers to optimization
SigOpt at GTC - Reducing operational barriers to optimization
 
Lessons for an enterprise approach to modeling at scale
Lessons for an enterprise approach to modeling at scaleLessons for an enterprise approach to modeling at scale
Lessons for an enterprise approach to modeling at scale
 
Modeling at scale in systematic trading
Modeling at scale in systematic tradingModeling at scale in systematic trading
Modeling at scale in systematic trading
 
SigOpt at MLconf - Reducing Operational Barriers to Model Training
SigOpt at MLconf - Reducing Operational Barriers to Model TrainingSigOpt at MLconf - Reducing Operational Barriers to Model Training
SigOpt at MLconf - Reducing Operational Barriers to Model Training
 
Machine Learning Infrastructure
Machine Learning InfrastructureMachine Learning Infrastructure
Machine Learning Infrastructure
 
Tuning the Untunable - Insights on Deep Learning Optimization
Tuning the Untunable - Insights on Deep Learning OptimizationTuning the Untunable - Insights on Deep Learning Optimization
Tuning the Untunable - Insights on Deep Learning Optimization
 
Machine Learning Fundamentals
Machine Learning FundamentalsMachine Learning Fundamentals
Machine Learning Fundamentals
 
Tips and techniques for hyperparameter optimization
Tips and techniques for hyperparameter optimizationTips and techniques for hyperparameter optimization
Tips and techniques for hyperparameter optimization
 
MLconf 2017 Seattle Lunch Talk - Using Optimal Learning to tune Deep Learning...
MLconf 2017 Seattle Lunch Talk - Using Optimal Learning to tune Deep Learning...MLconf 2017 Seattle Lunch Talk - Using Optimal Learning to tune Deep Learning...
MLconf 2017 Seattle Lunch Talk - Using Optimal Learning to tune Deep Learning...
 
Using Optimal Learning to Tune Deep Learning Pipelines
Using Optimal Learning to Tune Deep Learning PipelinesUsing Optimal Learning to Tune Deep Learning Pipelines
Using Optimal Learning to Tune Deep Learning Pipelines
 

Kürzlich hochgeladen

Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoordharasingh5698
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfRagavanV2
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projectssmsksolar
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 

Kürzlich hochgeladen (20)

Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 

Using Bayesian Optimization to Simultaneously Tune Multiple Metrics - Quantcon 2018

  • 1. Model Optimization with Competing Objectives QuantCon 2018 Scott Clark scott@sigopt.com
  • 2. OUTLINE 1. Why is Tuning Models Hard? 2. Common Tuning Methods 3. Deep Learning Example 4. Tuning Multiple Metrics 5. Multi-metric Optimization Examples
  • 3. Algorithmic Trading and AI / ML are extremely powerful Tuning these systems is extremely non-intuitive
  • 5. TUNABLE PARAMETERS IN DEEP LEARNING
  • 6. TUNABLE PARAMETERS IN DEEP LEARNING
  • 7. TUNABLE PARAMETERS IN DEEP LEARNING
  • 8. TUNABLE PARAMETERS IN DEEP LEARNING
  • 9. TUNABLE PARAMETERS IN DEEP LEARNING
  • 12. STANDARD TUNING METHODS Trading Models Data Backtest / Simulation Parameter Configuration ? Grid Search Random Search Manual Search - Weights - Thresholds - Window sizes - Transformations Domain Expertise
  • 13. OPTIMIZATION FEEDBACK LOOP Objective Metric Better Results REST API New configurations Trading Models Data Backtest / Simulation Domain Expertise
  • 14. ● Create a strategy to trade Select Sector SPDR ETFs ○ XLV, XLF, XLP, XLE, XLK, XLB, XLU, XLI ● Trade on common signals ○ Relative Strength Interest (RSI) ○ Rate of Change (ROC) ● Maximize Sharpe Ratio PROBLEM https://blog.quantopian.com/bayesian-optimization-of-a-technical-trading-algorithm-with-ziplinesigopt-2/
  • 15. TUNABLE PARAMETERS IN ALGO TRADING ● Relative Strength Interest (RSI) ○ Lookback window for # of prices used in the RSI calculation ○ Lower_bound value defining the trade entry condition ○ Range_width, which will be added to the Lower-bound ■ Lower_bound + Range_width is the range of values over which our RSI signal will be considered True ● Rate of Change (ROC) ○ Lookback window for # of prices used in the ROC calculation ○ Lower_bound value defining the trade entry condition ○ Range_width, which will be added to the Lower-bound ■ Lower_bound + Range_width is the range of values over which our ROC signal will be considered True ● Signal evaluation frequency ○ Number of days between evaluation of if our signals ■ Do we evaluate them every day, every week, every month, etc.
  • 16. COMBINATORIAL EXPLOSION ● RSI lookback window: 115 values (5 to 120) ● RSI lower bound: 90 values (0 to 90) ● RSI range width: 20 values (10 to 30) ● ROC lookback window: 61 values (2 to 63) ● ROC lower bound: 30 values (0 to 30) ● ROC range width: 195 values (5 to 200) ● Evaluation frequency: 18 values (3 to 21) = 1,329,623,100,000 possible configurations
  • 17. COMPARATIVE PERFORMANCE Grid Search Expert Grid ● Better: 200% Higher model returns than manual search ● Faster/Cheaper: 10x fewer evaluations vs standard methods BacktestPortfolioValue Time (2004-2012) Blog Post
  • 18. COMPARATIVE PERFORMANCE https://papers.ssrn.com/sol3/paper s.cfm?abstract_id=2745220 ● Out of sample performance is terrible ● We need better metrics
  • 19. TUNING MULTIPLE METRICS What if we want to optimize multiple competing metrics? ● Trading Tradeoffs ○ Sharpe Ratio vs Drawdown ○ Backtest Alpha vs Uncertainty ○ Quality vs Robustness ● Complexity Tradeoffs ○ Accuracy vs Training Time ○ Accuracy vs Inference Time
  • 20. PARETO OPTIMAL What does it mean to optimize two metrics simultaneously? Pareto efficiency or Pareto optimality is a state of allocation of resources from which it is impossible to reallocate so as to make any one individual or preference criterion better off without making at least one individual or preference criterion worse off.
  • 21. PARETO OPTIMAL What does it mean to optimize two metrics simultaneously? The red points are on the Pareto Efficient Frontier, they strictly dominate all of the grey points. You can do no better in one metric without sacrificing performance in the other. Point N is Pareto Optimal compared to Point K.
  • 22. PARETO EFFICIENT FRONTIER Goal is to have best set of feasible solutions to select from After optimization the expert picks one or more of the red points from the Pareto Efficient Frontier to further study or put into production.
  • 26. MULTI-METRIC OPT IN DEEP LEARNING https://devblogs.nvidia.com/sigopt-deep-learning-hyperparameter-optimization/
  • 27. DEEP LEARNING TRADEOFFS ● Deep Learning pipelines are time consuming and expensive to run ● Application and deployment conditions may make certain configurations less desirable ● Tuning for both accuracy and complexity metrics like training or inference time allows expert to make best decision for production
  • 28. ● Comparison of several RMSProp SGD parametrizations ● Different configurations converge differently STOCHASTIC GRADIENT DESCENT
  • 29. TEXT CLASSIFICATION PIPELINE ML / AI Model (MXNet) Testing Text Validation Accuracy Better Results REST API Hyperparameter Configurations and Feature Transformations Training Text Training Time
  • 31. SEQUENCE CLASSIFICATION PIPELINE ML / AI Model (Tensorflow) Testing Sequences Validation Accuracy Better Results REST API Hyperparameter Configurations and Feature Transformations Training Sequences Inference Time
  • 35. LOAN CLASSIFICATION PIPELINE ML / AI Model (LightGBM) Testing Data Validation AUCPR Better Results REST API Hyperparameter Configurations and Feature Transformations Training Data Avg $ Lost
  • 36. GRID SEARCH CAN MISLEAD ● Best grid search point (wrt accuracy) loses >$35 / transaction ● Best grid search point (wrt loss) has 70% accuracy ● Points of the Pareto Frontier give user more information about what is possible and more control of trade-offs
  • 37. TAKEAWAYS One metric may not paint the whole picture - Think about metric trade-offs in your model pipelines - Optimizing for the wrong thing can be very expensive Not all optimization strategies are equal - Pick an optimization strategy that gives the most flexibility - Different tools enable you to tackle new problems