SlideShare a Scribd company logo
1 of 33
Machine
Learning Pitfalls
Dan Elton
Silver Spring AI Information Meetup
2/21/18
2/22/2018 Dan Elton 2
What is a Machine Learning?
"Machine Learning is a field of study that gives computers the ability to learn without
being explicitly programmed" - Arthur Samuel, 1959
"A computer program is said to learn from experience E with respect to some class of
tasks T and performance measure P, if its performance at tasks in T, as measured by
P, improves with the experience E." - Tom M. Mitchell.
Reinforcement
learning
Unsupervised learningSupervised learning
• Regression
• Classification
Model Y = f(x) to match data (x,y)
• Parametric models
• Linear models
• Polynomial model
• Logistic model
• Neural network model
• Convolutional Neural network
• Non parametric models
• Kernel Ridge regression
• Decision tree
• Gaussian Process regression
• Kernel SVM
• Clustering
• Dimensionality
reduction
• Autoencoders
• Robotics , etc
2/22/2018 Dan Elton 3
Supervised learning workflow
Source : sci-kit-learn.org
Dan Elton, Silver Spring AI Information Meetup2/22/2018 4
Pitfall # 1 : Overfitting
Dan Elton, Silver Spring AI Information Meetup2/22/2018 5
Pitfall # 1 : Overfitting
Check for overfitting with cross validation
Look at the gap between performance in
training data and performance in test data.
It should be as small as possible.
Regularization and/or change
hyperparameters
Dan Elton, Silver Spring AI Information Meetup2/22/2018 6
Pitfall # 1 : Overfitting
Always show your test data score and your training data score
Error from overfitting
Error from bias
Dan Elton, Silver Spring AI Information Meetup2/22/2018 7
What is bias?
Meanings of the term “bias”
• Statistical bias: The “bias” part of the error term,
from the model not being the true model
• Biased training data
• Training data collected in a biased way
• Target signal leaks into data
• Social bias: when the ML system does things that
are against our values
The last two are closely related.
Dan Elton, Silver Spring AI Information Meetup2/22/2018 8
Statistical bias
Dan Elton, Silver Spring AI Information Meetup2/22/2018 9
Biased training data
The famous “tank story”
Dan Elton, Silver Spring AI Information Meetup2/22/2018 10
Biased training data
1. L. N. Kanal and N. C. Randall. 1964. Recognition system design by statistical
analysis. In Proceedings of the 1964 19th ACM national conference (ACM '64).
Should we be telling the tank story?
Gwern (https://www.gwern.net/Tanks) argues not since:
The story is often described as fact when there’s no evidence it actually
happened. Higher epistemic rigor should be demanded.
“the tank story tends to promote complacency and underestimation of the state of the
art ”
Yet the story is most likely based on real research done in the 60s on
trying to identify tanks in areal photos. 1 However, the published research
corrects for brightness levels by applying a Laplacian filter to the images.
Dan Elton, Silver Spring AI Information Meetup2/22/2018 11
Biased training data
In the 1990s, the Cost Effective Health Care (CEHC) funded
a study to see if ML could predict risk of death for patients
with pneumonia.
The most accurate model was a multi task neural net, with
an AUC=0.86 compared to 0.77 for logistic regression
The system was almost fielded, but the researchers felt it was
risky putting a black box model into production without
knowing at all how it was working. So they trained a rule-
based learning system on the same data. It had lower
accuracy, but was highly transparent. One rule it learned was:
HasAsthma(x)  LowerRisk(x)
A better story:
Cooper et al. Predicting dire outcomes of patients with community acquired pneumonia, Journal of Biomedical Informatics,
v.38 n.5, p.347-366, 2005
Caruana et al. 2015. Intelligible Models for HealthCare: Predicting Pneumonia Risk and Hospital 30-day Readmission.
In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining
https://vimeo.com/125940125
Dan Elton, Silver Spring AI Information Meetup2/22/2018 12
Bias
Problems of bias in social applications
Kate Crawford (NIPS, 2018) identifies 2 types of bias:
Harms of allocation
• Discrimination in products & services
• mortgage approval
• Parole granting
• Insurance rates
Harms of representation
• More subtle
• Perpetuation of social inequalities and stereotypes we
don’t want to be perpetuated
• Misrepresentation of sensitive topics like personal and
group identity
Dan Elton, Silver Spring AI Information Meetup2/22/2018 13
Bias
Examples of harms of distribution
Datta, Amit, Michael Carl Tschantz, and Anupam Datta. "Automated experiments on ad
privacy settings." Proceedings on Privacy Enhancing Technologies 2015.1 (2015): 92-
112. APA
Dan Elton, Silver Spring AI Information Meetup2/22/2018 14
Bias
Examples of harms of representation
Dan Elton, Silver Spring AI Information Meetup2/22/2018 15
Bias
Examples of harms of representation
A newly published study found high error rates for dark skinned women
-- Microsoft 21%
-- IBM – 35%
Less than 1% error for white males
Nytimes
Dan Elton, Silver Spring AI Information Meetup2/22/2018 16
Bias
Examples of harms of representation
This problem was fixed by Google in Dec. 2016
Dan Elton, Silver Spring AI Information Meetup2/22/2018 17
Bias
Examples of harms of representation
Sweeney L. Discrimination in Online Ad Delivery. Communications of the
Association of Computing Machinery (CACM), Vol. 56 No. 5, Pages 44-54
(2013) http://arxiv.org/abs/1301.6822.
Dan Elton, Silver Spring AI Information Meetup2/22/2018 18
Bias
1. L. N. Kanal and N. C. Randall. 1964. Recognition system design by statistical
analysis. In Proceedings of the 1964 19th ACM national conference (ACM '64).
Examples of harms of representation
Dan Elton, Silver Spring AI Information Meetup2/22/2018 19
Bias
Implicit gender bias in word2vec
Bolukbasi et al, Man is to Computer Programmer as Woman is to Homemaker? Debiasing Word Embeddings arXiv:1607.06520
(2016)
Biased gender associations:
midwife:doctor; sewing:carpentry, and registered_nurse:physician,
not biased
feminine:manly; convent:monastery; handbag:briefcase, etc
Dan Elton, Silver Spring AI Information Meetup2/22/2018 20
Parole granting case
Consider the COMPAS algorithm for granting parole.. It uses 100 variables/features/risk
factors. Race is not explicitly considered.
It was widely reported in the media as being biased because it granted parole to white
people with much higher probability.
The media criticized it for being biased.
Yet, conditional on risk factors considered legitimate (such as number of prior
convictions, etc) the system did not exhibit any bias between white people and black
people.
(Corbett-Davies et al 2017)
Trying to make the algorithm ‘fair’ has a real social cost, quantified by Corbet-Davies et
al.
Debiasing demo at https://research.google.com/bigpicture/attacking-discrimination-in-ml/
Dan Elton, Silver Spring AI Information Meetup2/22/2018 21
Simpson’s paradox (aka confounding)
Stanford Admissions
Dan Elton, Silver Spring AI Information Meetup2/22/2018 22
Pitfall – not cleaning your data
The “Schenectady Problem”
https://s6.io/schenectady-12345/
“The fallacies of self-
reported data”
Dan Elton, Silver Spring AI Information Meetup2/22/2018 23
Pitfall - Not normalizing your data
Kernel methods are based on the distance between points – if one
feature (dimension) is very large, it will dominate.
Normalization helps speed up optimization of models by removing
”long valleys” in the cost function:
Dan Elton, Silver Spring AI Information Meetup2/22/2018 24
Simpson’s paradox
Dan Elton, Silver Spring AI Information Meetup2/22/2018 25
Pitfall – not comparing with baseline predictors
Scikit-learn contains a
dummy repressor
which just returns the
mean y as well as
dummy classifiers
Dan Elton, Silver Spring AI Information Meetup2/22/2018 26
Pitfall - Not normalizing your data
It’s sometimes important to normalize the target variables as well
Log (y) or Logistic(y) can be used to ‘squash the data’ to a narrow range of values.
Kernel Ridge
Regression
Random Forest Support Vector
Regression
Dan Elton, Silver Spring AI Information Meetup2/22/2018 27
Pitfall: trying to extrapolate
What’s the next number in this
sequence?
1, 3, 5, 7, ?
Correct solution
217,341
Dan Elton, Silver Spring AI Information Meetup2/22/2018 28
Pitfall: trying to extrapolate
Sometimes you get lucky…
But typically machine learning
models with nonlinearity do not
extrapolate.
Dan Elton, Silver Spring AI Information Meetup2/22/2018 29
Is “data science” a “science” ?
Technically, yes.
Data scientists generally follow the scientific method :
They collect data
They create a “hypothesis” (the model to be fit)
They see if the model can fit the data. If it doesn’t, some parameters are tweaked.
Eventually, they test the model on test data.
If the model works, it goes into production (“becomes a theory”)
But are ML models falsafiable? ….. Sort of (?)
Dan Elton, Silver Spring AI Information Meetup2/22/2018 30
ML models are “bad explanations”
https://www.ted.com/talks/david_deutsch_a_new_way_to_explain_explanation
Good explanations of the world cannot
easily be changed to accommodate new
data
Dan Elton, Silver Spring AI Information Meetup2/22/2018 31
One way of looking at it…
2/22/2018 Dan Elton, P.W. Chung Group Meeting 32
Meta lesson – don’t be arrogant!
“With four parameters I can
fit an elephant, and with
five I can make him wiggle
his trunk.”
- John von Neumann
When you do regression, even with deep learning, typically all you are really
doing is curve fitting! Some ML can be recast as data compression. You
are not coming up with good explanations as to what is happening.
Dan Elton, Silver Spring AI Information Meetup2/22/2018 33
The End
Thanks for listening!

More Related Content

What's hot

Fairness in Machine Learning @Codemotion
Fairness in Machine Learning @CodemotionFairness in Machine Learning @Codemotion
Fairness in Machine Learning @CodemotionAzzurra Ragone
 
Knowledge-empowered Probabilistic Graphical Models for Physical-Cyber-Social ...
Knowledge-empowered Probabilistic Graphical Models for Physical-Cyber-Social ...Knowledge-empowered Probabilistic Graphical Models for Physical-Cyber-Social ...
Knowledge-empowered Probabilistic Graphical Models for Physical-Cyber-Social ...Artificial Intelligence Institute at UofSC
 
The State of Artificial Intelligence and What It Means for the Philippines
The State of Artificial Intelligence and What It Means for the PhilippinesThe State of Artificial Intelligence and What It Means for the Philippines
The State of Artificial Intelligence and What It Means for the PhilippinesThinking Machines
 
Extracting City Traffic Events from Social Streams
 Extracting City Traffic Events from Social Streams Extracting City Traffic Events from Social Streams
Extracting City Traffic Events from Social StreamsPramod Anantharam
 
The Ethics of Artificial Intelligence
The Ethics of Artificial IntelligenceThe Ethics of Artificial Intelligence
The Ethics of Artificial IntelligenceKarl Seiler
 
Machine learning with Big Data power point presentation
Machine learning with Big Data power point presentationMachine learning with Big Data power point presentation
Machine learning with Big Data power point presentationDavid Raj Kanthi
 
Data Science Isn't a Fad: Let's Keep it That Way
Data Science Isn't a Fad: Let's Keep it That WayData Science Isn't a Fad: Let's Keep it That Way
Data Science Isn't a Fad: Let's Keep it That WayMelinda Thielbar
 
Deep learning for biomedicine
Deep learning for biomedicineDeep learning for biomedicine
Deep learning for biomedicineDeakin University
 
Congress on Evolutionary Computation (CEC 2016) - Plenary Talk
Congress on Evolutionary Computation (CEC 2016) - Plenary TalkCongress on Evolutionary Computation (CEC 2016) - Plenary Talk
Congress on Evolutionary Computation (CEC 2016) - Plenary TalkGraham Kendall
 
Industrial Machine Learning (SIGKDD17)
Industrial Machine Learning (SIGKDD17)Industrial Machine Learning (SIGKDD17)
Industrial Machine Learning (SIGKDD17)Joshua Bloom
 
Responsible AI in Industry (ICML 2021 Tutorial)
Responsible AI in Industry (ICML 2021 Tutorial)Responsible AI in Industry (ICML 2021 Tutorial)
Responsible AI in Industry (ICML 2021 Tutorial)Krishnaram Kenthapadi
 
Introduction to Data Science and Analytics
Introduction to Data Science and AnalyticsIntroduction to Data Science and Analytics
Introduction to Data Science and AnalyticsSrinath Perera
 
University at Buffalo’s Center for Computational Research
University at Buffalo’s Center for Computational ResearchUniversity at Buffalo’s Center for Computational Research
University at Buffalo’s Center for Computational ResearchAllineaSoftware
 

What's hot (16)

Fairness in Machine Learning @Codemotion
Fairness in Machine Learning @CodemotionFairness in Machine Learning @Codemotion
Fairness in Machine Learning @Codemotion
 
Knowledge-empowered Probabilistic Graphical Models for Physical-Cyber-Social ...
Knowledge-empowered Probabilistic Graphical Models for Physical-Cyber-Social ...Knowledge-empowered Probabilistic Graphical Models for Physical-Cyber-Social ...
Knowledge-empowered Probabilistic Graphical Models for Physical-Cyber-Social ...
 
The State of Artificial Intelligence and What It Means for the Philippines
The State of Artificial Intelligence and What It Means for the PhilippinesThe State of Artificial Intelligence and What It Means for the Philippines
The State of Artificial Intelligence and What It Means for the Philippines
 
Extracting City Traffic Events from Social Streams
 Extracting City Traffic Events from Social Streams Extracting City Traffic Events from Social Streams
Extracting City Traffic Events from Social Streams
 
The Ethics of Artificial Intelligence
The Ethics of Artificial IntelligenceThe Ethics of Artificial Intelligence
The Ethics of Artificial Intelligence
 
Final Project
Final ProjectFinal Project
Final Project
 
Understanding City Traffic Dynamics Utilizing Sensor and Textual Observations
Understanding City Traffic Dynamics Utilizing Sensor and Textual ObservationsUnderstanding City Traffic Dynamics Utilizing Sensor and Textual Observations
Understanding City Traffic Dynamics Utilizing Sensor and Textual Observations
 
Machine learning with Big Data power point presentation
Machine learning with Big Data power point presentationMachine learning with Big Data power point presentation
Machine learning with Big Data power point presentation
 
Data Science Isn't a Fad: Let's Keep it That Way
Data Science Isn't a Fad: Let's Keep it That WayData Science Isn't a Fad: Let's Keep it That Way
Data Science Isn't a Fad: Let's Keep it That Way
 
Deep learning for biomedicine
Deep learning for biomedicineDeep learning for biomedicine
Deep learning for biomedicine
 
Congress on Evolutionary Computation (CEC 2016) - Plenary Talk
Congress on Evolutionary Computation (CEC 2016) - Plenary TalkCongress on Evolutionary Computation (CEC 2016) - Plenary Talk
Congress on Evolutionary Computation (CEC 2016) - Plenary Talk
 
Industrial Machine Learning (SIGKDD17)
Industrial Machine Learning (SIGKDD17)Industrial Machine Learning (SIGKDD17)
Industrial Machine Learning (SIGKDD17)
 
Responsible AI in Industry (ICML 2021 Tutorial)
Responsible AI in Industry (ICML 2021 Tutorial)Responsible AI in Industry (ICML 2021 Tutorial)
Responsible AI in Industry (ICML 2021 Tutorial)
 
AI for Science
AI for ScienceAI for Science
AI for Science
 
Introduction to Data Science and Analytics
Introduction to Data Science and AnalyticsIntroduction to Data Science and Analytics
Introduction to Data Science and Analytics
 
University at Buffalo’s Center for Computational Research
University at Buffalo’s Center for Computational ResearchUniversity at Buffalo’s Center for Computational Research
University at Buffalo’s Center for Computational Research
 

Similar to Avoiding Machine Learning Pitfalls 2-10-18

Introduction to the ethics of machine learning
Introduction to the ethics of machine learningIntroduction to the ethics of machine learning
Introduction to the ethics of machine learningDaniel Wilson
 
Fairness in Machine Learning
Fairness in Machine LearningFairness in Machine Learning
Fairness in Machine LearningDelip Rao
 
Ethical Issues in Machine Learning Algorithms (Part 2)
Ethical Issues in Machine Learning Algorithms (Part 2)Ethical Issues in Machine Learning Algorithms (Part 2)
Ethical Issues in Machine Learning Algorithms (Part 2)Vladimir Kanchev
 
Everything you always wanted to know about Synthetic Data
Everything you always wanted to know about Synthetic DataEverything you always wanted to know about Synthetic Data
Everything you always wanted to know about Synthetic DataMOSTLY AI
 
Transparency in ML and AI (humble views from a concerned academic)
Transparency in ML and AI (humble views from a concerned academic)Transparency in ML and AI (humble views from a concerned academic)
Transparency in ML and AI (humble views from a concerned academic)Paolo Missier
 
Bigger than Any One: Solving Large Scale Data Problems with People and Machines
Bigger than Any One: Solving Large Scale Data Problems with People and MachinesBigger than Any One: Solving Large Scale Data Problems with People and Machines
Bigger than Any One: Solving Large Scale Data Problems with People and MachinesTyler Bell
 
Deep Neural Networks for Machine Learning
Deep Neural Networks for Machine LearningDeep Neural Networks for Machine Learning
Deep Neural Networks for Machine LearningJustin Beirold
 
Machine Learning ICS 273A
Machine Learning ICS 273AMachine Learning ICS 273A
Machine Learning ICS 273Abutest
 
Machine Learning ICS 273A
Machine Learning ICS 273AMachine Learning ICS 273A
Machine Learning ICS 273Abutest
 
Ntegra 20231003 v3.pptx
Ntegra 20231003 v3.pptxNtegra 20231003 v3.pptx
Ntegra 20231003 v3.pptxISSIP
 
introduction to machin learning
introduction to machin learningintroduction to machin learning
introduction to machin learningnilimapatel6
 
Eick/Alpaydin Introduction
Eick/Alpaydin IntroductionEick/Alpaydin Introduction
Eick/Alpaydin Introductionbutest
 
JanData-mining-to-knowledge-discovery.ppt
JanData-mining-to-knowledge-discovery.pptJanData-mining-to-knowledge-discovery.ppt
JanData-mining-to-knowledge-discovery.pptgeorgejustymirobi1
 
Introduction to Data Mining and technologies .ppt
Introduction to Data Mining and technologies .pptIntroduction to Data Mining and technologies .ppt
Introduction to Data Mining and technologies .pptSangrangBargayary3
 
Machine Learning, Data Mining, and
Machine Learning, Data Mining, and Machine Learning, Data Mining, and
Machine Learning, Data Mining, and butest
 
Keynote on 2015 Yale Day of Data
Keynote on 2015 Yale Day of Data Keynote on 2015 Yale Day of Data
Keynote on 2015 Yale Day of Data Robert Grossman
 

Similar to Avoiding Machine Learning Pitfalls 2-10-18 (20)

Introduction to the ethics of machine learning
Introduction to the ethics of machine learningIntroduction to the ethics of machine learning
Introduction to the ethics of machine learning
 
The Ethics of AI
The Ethics of AIThe Ethics of AI
The Ethics of AI
 
20181212 ibm aot
20181212 ibm aot20181212 ibm aot
20181212 ibm aot
 
Fairness in Machine Learning
Fairness in Machine LearningFairness in Machine Learning
Fairness in Machine Learning
 
Ethical Issues in Machine Learning Algorithms (Part 2)
Ethical Issues in Machine Learning Algorithms (Part 2)Ethical Issues in Machine Learning Algorithms (Part 2)
Ethical Issues in Machine Learning Algorithms (Part 2)
 
Everything you always wanted to know about Synthetic Data
Everything you always wanted to know about Synthetic DataEverything you always wanted to know about Synthetic Data
Everything you always wanted to know about Synthetic Data
 
Transparency in ML and AI (humble views from a concerned academic)
Transparency in ML and AI (humble views from a concerned academic)Transparency in ML and AI (humble views from a concerned academic)
Transparency in ML and AI (humble views from a concerned academic)
 
Bigger than Any One: Solving Large Scale Data Problems with People and Machines
Bigger than Any One: Solving Large Scale Data Problems with People and MachinesBigger than Any One: Solving Large Scale Data Problems with People and Machines
Bigger than Any One: Solving Large Scale Data Problems with People and Machines
 
Math2015
Math2015Math2015
Math2015
 
Deep Neural Networks for Machine Learning
Deep Neural Networks for Machine LearningDeep Neural Networks for Machine Learning
Deep Neural Networks for Machine Learning
 
Machine Learning ICS 273A
Machine Learning ICS 273AMachine Learning ICS 273A
Machine Learning ICS 273A
 
Machine Learning ICS 273A
Machine Learning ICS 273AMachine Learning ICS 273A
Machine Learning ICS 273A
 
Ntegra 20231003 v3.pptx
Ntegra 20231003 v3.pptxNtegra 20231003 v3.pptx
Ntegra 20231003 v3.pptx
 
introduction to machin learning
introduction to machin learningintroduction to machin learning
introduction to machin learning
 
i2ml3e-chap1.pptx
i2ml3e-chap1.pptxi2ml3e-chap1.pptx
i2ml3e-chap1.pptx
 
Eick/Alpaydin Introduction
Eick/Alpaydin IntroductionEick/Alpaydin Introduction
Eick/Alpaydin Introduction
 
JanData-mining-to-knowledge-discovery.ppt
JanData-mining-to-knowledge-discovery.pptJanData-mining-to-knowledge-discovery.ppt
JanData-mining-to-knowledge-discovery.ppt
 
Introduction to Data Mining and technologies .ppt
Introduction to Data Mining and technologies .pptIntroduction to Data Mining and technologies .ppt
Introduction to Data Mining and technologies .ppt
 
Machine Learning, Data Mining, and
Machine Learning, Data Mining, and Machine Learning, Data Mining, and
Machine Learning, Data Mining, and
 
Keynote on 2015 Yale Day of Data
Keynote on 2015 Yale Day of Data Keynote on 2015 Yale Day of Data
Keynote on 2015 Yale Day of Data
 

Recently uploaded

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Recently uploaded (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Avoiding Machine Learning Pitfalls 2-10-18

  • 1. Machine Learning Pitfalls Dan Elton Silver Spring AI Information Meetup 2/21/18
  • 2. 2/22/2018 Dan Elton 2 What is a Machine Learning? "Machine Learning is a field of study that gives computers the ability to learn without being explicitly programmed" - Arthur Samuel, 1959 "A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with the experience E." - Tom M. Mitchell. Reinforcement learning Unsupervised learningSupervised learning • Regression • Classification Model Y = f(x) to match data (x,y) • Parametric models • Linear models • Polynomial model • Logistic model • Neural network model • Convolutional Neural network • Non parametric models • Kernel Ridge regression • Decision tree • Gaussian Process regression • Kernel SVM • Clustering • Dimensionality reduction • Autoencoders • Robotics , etc
  • 3. 2/22/2018 Dan Elton 3 Supervised learning workflow Source : sci-kit-learn.org
  • 4. Dan Elton, Silver Spring AI Information Meetup2/22/2018 4 Pitfall # 1 : Overfitting
  • 5. Dan Elton, Silver Spring AI Information Meetup2/22/2018 5 Pitfall # 1 : Overfitting Check for overfitting with cross validation Look at the gap between performance in training data and performance in test data. It should be as small as possible. Regularization and/or change hyperparameters
  • 6. Dan Elton, Silver Spring AI Information Meetup2/22/2018 6 Pitfall # 1 : Overfitting Always show your test data score and your training data score Error from overfitting Error from bias
  • 7. Dan Elton, Silver Spring AI Information Meetup2/22/2018 7 What is bias? Meanings of the term “bias” • Statistical bias: The “bias” part of the error term, from the model not being the true model • Biased training data • Training data collected in a biased way • Target signal leaks into data • Social bias: when the ML system does things that are against our values The last two are closely related.
  • 8. Dan Elton, Silver Spring AI Information Meetup2/22/2018 8 Statistical bias
  • 9. Dan Elton, Silver Spring AI Information Meetup2/22/2018 9 Biased training data The famous “tank story”
  • 10. Dan Elton, Silver Spring AI Information Meetup2/22/2018 10 Biased training data 1. L. N. Kanal and N. C. Randall. 1964. Recognition system design by statistical analysis. In Proceedings of the 1964 19th ACM national conference (ACM '64). Should we be telling the tank story? Gwern (https://www.gwern.net/Tanks) argues not since: The story is often described as fact when there’s no evidence it actually happened. Higher epistemic rigor should be demanded. “the tank story tends to promote complacency and underestimation of the state of the art ” Yet the story is most likely based on real research done in the 60s on trying to identify tanks in areal photos. 1 However, the published research corrects for brightness levels by applying a Laplacian filter to the images.
  • 11. Dan Elton, Silver Spring AI Information Meetup2/22/2018 11 Biased training data In the 1990s, the Cost Effective Health Care (CEHC) funded a study to see if ML could predict risk of death for patients with pneumonia. The most accurate model was a multi task neural net, with an AUC=0.86 compared to 0.77 for logistic regression The system was almost fielded, but the researchers felt it was risky putting a black box model into production without knowing at all how it was working. So they trained a rule- based learning system on the same data. It had lower accuracy, but was highly transparent. One rule it learned was: HasAsthma(x)  LowerRisk(x) A better story: Cooper et al. Predicting dire outcomes of patients with community acquired pneumonia, Journal of Biomedical Informatics, v.38 n.5, p.347-366, 2005 Caruana et al. 2015. Intelligible Models for HealthCare: Predicting Pneumonia Risk and Hospital 30-day Readmission. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining https://vimeo.com/125940125
  • 12. Dan Elton, Silver Spring AI Information Meetup2/22/2018 12 Bias Problems of bias in social applications Kate Crawford (NIPS, 2018) identifies 2 types of bias: Harms of allocation • Discrimination in products & services • mortgage approval • Parole granting • Insurance rates Harms of representation • More subtle • Perpetuation of social inequalities and stereotypes we don’t want to be perpetuated • Misrepresentation of sensitive topics like personal and group identity
  • 13. Dan Elton, Silver Spring AI Information Meetup2/22/2018 13 Bias Examples of harms of distribution Datta, Amit, Michael Carl Tschantz, and Anupam Datta. "Automated experiments on ad privacy settings." Proceedings on Privacy Enhancing Technologies 2015.1 (2015): 92- 112. APA
  • 14. Dan Elton, Silver Spring AI Information Meetup2/22/2018 14 Bias Examples of harms of representation
  • 15. Dan Elton, Silver Spring AI Information Meetup2/22/2018 15 Bias Examples of harms of representation A newly published study found high error rates for dark skinned women -- Microsoft 21% -- IBM – 35% Less than 1% error for white males Nytimes
  • 16. Dan Elton, Silver Spring AI Information Meetup2/22/2018 16 Bias Examples of harms of representation This problem was fixed by Google in Dec. 2016
  • 17. Dan Elton, Silver Spring AI Information Meetup2/22/2018 17 Bias Examples of harms of representation Sweeney L. Discrimination in Online Ad Delivery. Communications of the Association of Computing Machinery (CACM), Vol. 56 No. 5, Pages 44-54 (2013) http://arxiv.org/abs/1301.6822.
  • 18. Dan Elton, Silver Spring AI Information Meetup2/22/2018 18 Bias 1. L. N. Kanal and N. C. Randall. 1964. Recognition system design by statistical analysis. In Proceedings of the 1964 19th ACM national conference (ACM '64). Examples of harms of representation
  • 19. Dan Elton, Silver Spring AI Information Meetup2/22/2018 19 Bias Implicit gender bias in word2vec Bolukbasi et al, Man is to Computer Programmer as Woman is to Homemaker? Debiasing Word Embeddings arXiv:1607.06520 (2016) Biased gender associations: midwife:doctor; sewing:carpentry, and registered_nurse:physician, not biased feminine:manly; convent:monastery; handbag:briefcase, etc
  • 20. Dan Elton, Silver Spring AI Information Meetup2/22/2018 20 Parole granting case Consider the COMPAS algorithm for granting parole.. It uses 100 variables/features/risk factors. Race is not explicitly considered. It was widely reported in the media as being biased because it granted parole to white people with much higher probability. The media criticized it for being biased. Yet, conditional on risk factors considered legitimate (such as number of prior convictions, etc) the system did not exhibit any bias between white people and black people. (Corbett-Davies et al 2017) Trying to make the algorithm ‘fair’ has a real social cost, quantified by Corbet-Davies et al. Debiasing demo at https://research.google.com/bigpicture/attacking-discrimination-in-ml/
  • 21. Dan Elton, Silver Spring AI Information Meetup2/22/2018 21 Simpson’s paradox (aka confounding) Stanford Admissions
  • 22. Dan Elton, Silver Spring AI Information Meetup2/22/2018 22 Pitfall – not cleaning your data The “Schenectady Problem” https://s6.io/schenectady-12345/ “The fallacies of self- reported data”
  • 23. Dan Elton, Silver Spring AI Information Meetup2/22/2018 23 Pitfall - Not normalizing your data Kernel methods are based on the distance between points – if one feature (dimension) is very large, it will dominate. Normalization helps speed up optimization of models by removing ”long valleys” in the cost function:
  • 24. Dan Elton, Silver Spring AI Information Meetup2/22/2018 24 Simpson’s paradox
  • 25. Dan Elton, Silver Spring AI Information Meetup2/22/2018 25 Pitfall – not comparing with baseline predictors Scikit-learn contains a dummy repressor which just returns the mean y as well as dummy classifiers
  • 26. Dan Elton, Silver Spring AI Information Meetup2/22/2018 26 Pitfall - Not normalizing your data It’s sometimes important to normalize the target variables as well Log (y) or Logistic(y) can be used to ‘squash the data’ to a narrow range of values. Kernel Ridge Regression Random Forest Support Vector Regression
  • 27. Dan Elton, Silver Spring AI Information Meetup2/22/2018 27 Pitfall: trying to extrapolate What’s the next number in this sequence? 1, 3, 5, 7, ? Correct solution 217,341
  • 28. Dan Elton, Silver Spring AI Information Meetup2/22/2018 28 Pitfall: trying to extrapolate Sometimes you get lucky… But typically machine learning models with nonlinearity do not extrapolate.
  • 29. Dan Elton, Silver Spring AI Information Meetup2/22/2018 29 Is “data science” a “science” ? Technically, yes. Data scientists generally follow the scientific method : They collect data They create a “hypothesis” (the model to be fit) They see if the model can fit the data. If it doesn’t, some parameters are tweaked. Eventually, they test the model on test data. If the model works, it goes into production (“becomes a theory”) But are ML models falsafiable? ….. Sort of (?)
  • 30. Dan Elton, Silver Spring AI Information Meetup2/22/2018 30 ML models are “bad explanations” https://www.ted.com/talks/david_deutsch_a_new_way_to_explain_explanation Good explanations of the world cannot easily be changed to accommodate new data
  • 31. Dan Elton, Silver Spring AI Information Meetup2/22/2018 31 One way of looking at it…
  • 32. 2/22/2018 Dan Elton, P.W. Chung Group Meeting 32 Meta lesson – don’t be arrogant! “With four parameters I can fit an elephant, and with five I can make him wiggle his trunk.” - John von Neumann When you do regression, even with deep learning, typically all you are really doing is curve fitting! Some ML can be recast as data compression. You are not coming up with good explanations as to what is happening.
  • 33. Dan Elton, Silver Spring AI Information Meetup2/22/2018 33 The End Thanks for listening!

Editor's Notes

  1. 1