SlideShare uma empresa Scribd logo
1 de 24
Baixar para ler offline
Consistency is a Skill
Evaluating umpire performance with machine learning
Who I am
I tweet about random nonsense: @PeterKBonney
Some of my code is on github: github.com/pbonney
I have a (non-baseball) company: @Vendorful
I occasionally write stuff: The Hardball Times
This photo has no relevance but it’s pretty cute
Machine learning and umpire consistency, in 12 minutes
or less:
Background and goal
How to think about machine learning
Modeling strike zones, with and without ML
Evaluating ML classification models
Umpire consistency is a skill
You too can use machine learning
@PeterKBonney
github.com/pbonney
Background and goal
@PeterKBonney
github.com/pbonney
How should you evaluate an umpire?
Tom Tango’s idea: Model each umpire’s individual strike zone with goal of finding
who calls the zone most consistently with themselves1:
𝑈𝐶𝑆 𝑝𝑖𝑡𝑐ℎ = 2𝑝 − 1 ∗ (𝑐 − 𝑝)
Examples:
𝑝 = 0.9, 𝑐 = 1 → 𝑈𝐶𝑆 = 0.08
𝑝 = 0.9, 𝑐 = 0 → 𝑈𝐶𝑆 = −0.72
To implement UCS, we need a model of p. Enter machine learning… @PeterKBonney
github.com/pbonney1 http://tangotiger.com/index.php/site/article/evaluatiing-the-effectiveness-of-an-umpire-effectively
How to think about machine learning
@PeterKBonney
github.com/pbonney
Obviously we must start by talking about the Singularity
@PeterKBonney
github.com/pbonney
A.I. recognizes Willie
Bloomquist as G.O.A.T.
But seriously, machine learning is like regression
Regression:
Machine learning:
<x1 , x2 , x3 , … > <y> (math) f(x1 , x2 , x3 , …) ~ y
<x1 , x2 , x3 , … > <y> (math) f(x1 , x2 , x3 , …) ~ y
@PeterKBonney
github.com/pbonney
ML’s wheelhouse: complicated, unconstrained data
Data:
“Hi everyone, I’m a wave!”
ML model:
“Why yes you are… mmm, curvy…”
Regression:
“Nah, pretty sure you’re a line.”
@PeterKBonney
github.com/pbonney
Neural networks are the David Ortiz of ML models
(Because they’ve been around forever and are still useful, not because they can’t run and don’t play D.)
@PeterKBonney
github.com/pbonney
All the ML models in this
presentation are neural
network models
Modeling strike zones with and without ML
@PeterKBonney
github.com/pbonney
How do you model an umpire’s called strike zone?
Draw a box? Divide into small buckets and compute historical
frequency?
@PeterKBonney
github.com/pbonney
NN model of umpire behavior
@PeterKBonney
github.com/pbonney
Or… teach a neural network to mimic the mind of an umpire!
Actual called pitches
Evaluating ML classification models
@PeterKBonney
github.com/pbonney
Receiver Operating Characteristic (ROC)
A common measure of binary classification systems. Plot “true positive” rate vs. “false
positive” rate at various discrimination thresholds then compare them.
TL;DR: Draw a graph, larger area under curve == better classification
(Name comes from use in WWII evaluating the performance of radar operators)
@PeterKBonney
github.com/pbonney
How does our simple ML umpire model perform?
@PeterKBonney
github.com/pbonney
Heart of zone and way out of zone are too easy,
so let’s just look at area between the red boxes.
Recall this plot of ball/strike frequencies:
Naïve model:
Inside yellow box = strike
Outside yellow box = ball
Umpire consistency is a skill
@PeterKBonney
github.com/pbonney
Now that we have a good modeling methodology, recall:
𝑈𝐶𝑆 𝑝𝑖𝑡𝑐ℎ = 2𝑝 − 1 ∗ (𝑐 − 𝑝)
Examples:
𝑝 = 0.9, 𝑐 = 1 → 𝑈𝐶𝑆 = 0.08
𝑝 = 0.9, 𝑐 = 0 → 𝑈𝐶𝑆 = −0.72
@PeterKBonney
github.com/pbonney
According to UCS, strike zone consistency is a skill
Split-half reliability:
• Divide pitches into odd/even samples of size N, calculate UCS for each
• Compute correlation between odd/even samples at N=100, N=200, etc.
• Find N where correlation between odd/even samples 0.5
I found: N ~ 940
So after c. 6 games UCS looks like equal parts luck and skill.
(Which means it IS a skill!)
Read more about UCS in the 2016 Hardball Times Annual
@PeterKBonney
github.com/pbonney
You too can use machine learning
@PeterKBonney
github.com/pbonney
With R ‘neuralnet’ package:
m <- neuralnet(c~px+pz,data=df,hidden=h,linear.output=FALSE)
Where:
• c is the call (1 for strike, 0 for ball)
• px and pz are the PITCHf/x horizontal and vertical locations
• df is a data frame of training data (with columns c, px and pz)
• h is the number of “hidden” neurons
How to train a neural network model in one easy step
@PeterKBonney
github.com/pbonney
ML can do more… let’s add other variables to the model
ML is particularly good at incorporating
variables that don’t easily fit in simple
models.
For example… what happens if we add
horizontal and vertical pitch movement
to the inputs?
We’ll also focus on the most borderline
pitches: in locations historically called as
strikes 25-75% of the time.
@PeterKBonney
github.com/pbonney
Umpires aren’t strongly influenced by pitch movement!
It has never been easier to give machine learning a try
Machine learning as a service:
• Cloud ML products from Google, Amazon, Microsoft (Azure)
Run it at home for free:
• ML packages for R and Python
Use with caution: don’t overfit, don’t mix training and evaluation data, don’t treat
models cruelly and p*ss off our future robot overlords.
Feel free to reach out if you want a hand getting started, but note that I’m a dabbler,
not a data scientist or computer scientist or any other kind of scientist.
@PeterKBonney
github.com/pbonney
100%
of this presentation is now done.
Thank you.
@PeterKBonney
github.com/pbonney

Mais conteúdo relacionado

Destaque (9)

Practica 6,7,8 y 9
Practica 6,7,8 y 9Practica 6,7,8 y 9
Practica 6,7,8 y 9
 
Raquel\'s projects @ HOSPER
Raquel\'s projects @ HOSPERRaquel\'s projects @ HOSPER
Raquel\'s projects @ HOSPER
 
Kkpi smkn 28 jakarta
Kkpi smkn 28 jakartaKkpi smkn 28 jakarta
Kkpi smkn 28 jakarta
 
Quality criteria of blended learning vw presentation
Quality criteria of blended learning vw presentationQuality criteria of blended learning vw presentation
Quality criteria of blended learning vw presentation
 
PERIODISMO POLITICO
PERIODISMO POLITICO PERIODISMO POLITICO
PERIODISMO POLITICO
 
Poltavskaya bitva
Poltavskaya bitvaPoltavskaya bitva
Poltavskaya bitva
 
Amplificadores operacionales
Amplificadores operacionalesAmplificadores operacionales
Amplificadores operacionales
 
Maskot itu Penting
Maskot itu PentingMaskot itu Penting
Maskot itu Penting
 
Static mixer
Static mixerStatic mixer
Static mixer
 

Semelhante a Bonney_Saberseminar_2016

Machine Learning and Inductive Inference
Machine Learning and Inductive InferenceMachine Learning and Inductive Inference
Machine Learning and Inductive Inference
butest
 
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docxBTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
AASTHA76
 
Data Science Accelerator Program
Data Science Accelerator ProgramData Science Accelerator Program
Data Science Accelerator Program
GoDataDriven
 

Semelhante a Bonney_Saberseminar_2016 (20)

What does OOP stand for?
What does OOP stand for?What does OOP stand for?
What does OOP stand for?
 
Mining Social Web APIs with IPython Notebook (Strata 2013)
Mining Social Web APIs with IPython Notebook (Strata 2013)Mining Social Web APIs with IPython Notebook (Strata 2013)
Mining Social Web APIs with IPython Notebook (Strata 2013)
 
Keepler Data Tech | Entendiendo tus propios modelos predictivos
Keepler Data Tech | Entendiendo tus propios modelos predictivosKeepler Data Tech | Entendiendo tus propios modelos predictivos
Keepler Data Tech | Entendiendo tus propios modelos predictivos
 
Machine Learning and Inductive Inference
Machine Learning and Inductive InferenceMachine Learning and Inductive Inference
Machine Learning and Inductive Inference
 
AI.ppt
AI.pptAI.ppt
AI.ppt
 
Deep Learning and the state of AI / 2016
Deep Learning and the state of AI / 2016Deep Learning and the state of AI / 2016
Deep Learning and the state of AI / 2016
 
Deep Learning from Scratch - Building with Python from First Principles.pdf
Deep Learning from Scratch - Building with Python from First Principles.pdfDeep Learning from Scratch - Building with Python from First Principles.pdf
Deep Learning from Scratch - Building with Python from First Principles.pdf
 
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docxBTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
 
From DevOps to MLOps: practical steps for a smooth transition
From DevOps to MLOps: practical steps for a smooth transitionFrom DevOps to MLOps: practical steps for a smooth transition
From DevOps to MLOps: practical steps for a smooth transition
 
STEAMy AI in Education_VWEC AI Expert Series.pdf
STEAMy AI in Education_VWEC AI Expert Series.pdfSTEAMy AI in Education_VWEC AI Expert Series.pdf
STEAMy AI in Education_VWEC AI Expert Series.pdf
 
17- Kernels and Clustering.pptx
17- Kernels and Clustering.pptx17- Kernels and Clustering.pptx
17- Kernels and Clustering.pptx
 
A Developer's Guide To Machine Learning
A Developer's Guide To Machine LearningA Developer's Guide To Machine Learning
A Developer's Guide To Machine Learning
 
Welcome-to-AI-Focused-CourseLast.pptx
Welcome-to-AI-Focused-CourseLast.pptxWelcome-to-AI-Focused-CourseLast.pptx
Welcome-to-AI-Focused-CourseLast.pptx
 
Accelerating Data Science through Feature Platform, Transformers, and GenAI
Accelerating Data Science through Feature Platform, Transformers, and GenAIAccelerating Data Science through Feature Platform, Transformers, and GenAI
Accelerating Data Science through Feature Platform, Transformers, and GenAI
 
Screencasting and Presenting for Engineers
Screencasting and Presenting for EngineersScreencasting and Presenting for Engineers
Screencasting and Presenting for Engineers
 
Pointers andmemory
Pointers andmemoryPointers andmemory
Pointers andmemory
 
Pattern matching presentation
Pattern matching presentationPattern matching presentation
Pattern matching presentation
 
A Friendly Introduction to Machine Learning
A Friendly Introduction to Machine LearningA Friendly Introduction to Machine Learning
A Friendly Introduction to Machine Learning
 
Data Science Accelerator Program
Data Science Accelerator ProgramData Science Accelerator Program
Data Science Accelerator Program
 
Large Scale Deep Learning with TensorFlow
Large Scale Deep Learning with TensorFlow Large Scale Deep Learning with TensorFlow
Large Scale Deep Learning with TensorFlow
 

Bonney_Saberseminar_2016

  • 1. Consistency is a Skill Evaluating umpire performance with machine learning
  • 2. Who I am I tweet about random nonsense: @PeterKBonney Some of my code is on github: github.com/pbonney I have a (non-baseball) company: @Vendorful I occasionally write stuff: The Hardball Times This photo has no relevance but it’s pretty cute
  • 3. Machine learning and umpire consistency, in 12 minutes or less: Background and goal How to think about machine learning Modeling strike zones, with and without ML Evaluating ML classification models Umpire consistency is a skill You too can use machine learning @PeterKBonney github.com/pbonney
  • 5. How should you evaluate an umpire? Tom Tango’s idea: Model each umpire’s individual strike zone with goal of finding who calls the zone most consistently with themselves1: 𝑈𝐶𝑆 𝑝𝑖𝑡𝑐ℎ = 2𝑝 − 1 ∗ (𝑐 − 𝑝) Examples: 𝑝 = 0.9, 𝑐 = 1 → 𝑈𝐶𝑆 = 0.08 𝑝 = 0.9, 𝑐 = 0 → 𝑈𝐶𝑆 = −0.72 To implement UCS, we need a model of p. Enter machine learning… @PeterKBonney github.com/pbonney1 http://tangotiger.com/index.php/site/article/evaluatiing-the-effectiveness-of-an-umpire-effectively
  • 6. How to think about machine learning @PeterKBonney github.com/pbonney
  • 7. Obviously we must start by talking about the Singularity @PeterKBonney github.com/pbonney A.I. recognizes Willie Bloomquist as G.O.A.T.
  • 8. But seriously, machine learning is like regression Regression: Machine learning: <x1 , x2 , x3 , … > <y> (math) f(x1 , x2 , x3 , …) ~ y <x1 , x2 , x3 , … > <y> (math) f(x1 , x2 , x3 , …) ~ y @PeterKBonney github.com/pbonney
  • 9. ML’s wheelhouse: complicated, unconstrained data Data: “Hi everyone, I’m a wave!” ML model: “Why yes you are… mmm, curvy…” Regression: “Nah, pretty sure you’re a line.” @PeterKBonney github.com/pbonney
  • 10. Neural networks are the David Ortiz of ML models (Because they’ve been around forever and are still useful, not because they can’t run and don’t play D.) @PeterKBonney github.com/pbonney All the ML models in this presentation are neural network models
  • 11. Modeling strike zones with and without ML @PeterKBonney github.com/pbonney
  • 12. How do you model an umpire’s called strike zone? Draw a box? Divide into small buckets and compute historical frequency? @PeterKBonney github.com/pbonney
  • 13. NN model of umpire behavior @PeterKBonney github.com/pbonney Or… teach a neural network to mimic the mind of an umpire! Actual called pitches
  • 14. Evaluating ML classification models @PeterKBonney github.com/pbonney
  • 15. Receiver Operating Characteristic (ROC) A common measure of binary classification systems. Plot “true positive” rate vs. “false positive” rate at various discrimination thresholds then compare them. TL;DR: Draw a graph, larger area under curve == better classification (Name comes from use in WWII evaluating the performance of radar operators) @PeterKBonney github.com/pbonney
  • 16. How does our simple ML umpire model perform? @PeterKBonney github.com/pbonney Heart of zone and way out of zone are too easy, so let’s just look at area between the red boxes. Recall this plot of ball/strike frequencies: Naïve model: Inside yellow box = strike Outside yellow box = ball
  • 17. Umpire consistency is a skill @PeterKBonney github.com/pbonney
  • 18. Now that we have a good modeling methodology, recall: 𝑈𝐶𝑆 𝑝𝑖𝑡𝑐ℎ = 2𝑝 − 1 ∗ (𝑐 − 𝑝) Examples: 𝑝 = 0.9, 𝑐 = 1 → 𝑈𝐶𝑆 = 0.08 𝑝 = 0.9, 𝑐 = 0 → 𝑈𝐶𝑆 = −0.72 @PeterKBonney github.com/pbonney
  • 19. According to UCS, strike zone consistency is a skill Split-half reliability: • Divide pitches into odd/even samples of size N, calculate UCS for each • Compute correlation between odd/even samples at N=100, N=200, etc. • Find N where correlation between odd/even samples 0.5 I found: N ~ 940 So after c. 6 games UCS looks like equal parts luck and skill. (Which means it IS a skill!) Read more about UCS in the 2016 Hardball Times Annual @PeterKBonney github.com/pbonney
  • 20. You too can use machine learning @PeterKBonney github.com/pbonney
  • 21. With R ‘neuralnet’ package: m <- neuralnet(c~px+pz,data=df,hidden=h,linear.output=FALSE) Where: • c is the call (1 for strike, 0 for ball) • px and pz are the PITCHf/x horizontal and vertical locations • df is a data frame of training data (with columns c, px and pz) • h is the number of “hidden” neurons How to train a neural network model in one easy step @PeterKBonney github.com/pbonney
  • 22. ML can do more… let’s add other variables to the model ML is particularly good at incorporating variables that don’t easily fit in simple models. For example… what happens if we add horizontal and vertical pitch movement to the inputs? We’ll also focus on the most borderline pitches: in locations historically called as strikes 25-75% of the time. @PeterKBonney github.com/pbonney Umpires aren’t strongly influenced by pitch movement!
  • 23. It has never been easier to give machine learning a try Machine learning as a service: • Cloud ML products from Google, Amazon, Microsoft (Azure) Run it at home for free: • ML packages for R and Python Use with caution: don’t overfit, don’t mix training and evaluation data, don’t treat models cruelly and p*ss off our future robot overlords. Feel free to reach out if you want a hand getting started, but note that I’m a dabbler, not a data scientist or computer scientist or any other kind of scientist. @PeterKBonney github.com/pbonney
  • 24. 100% of this presentation is now done. Thank you. @PeterKBonney github.com/pbonney