SlideShare a Scribd company logo
Tune up your data science process
Benjamin S. Skrainka
February 10, 2016
Benjamin S. Skrainka Tune up your data science process February 10, 2016 1 / 24
The correctness problem
A lot of (data) science is unscientific:
“My code runs, so the answer must be correct”
“It passed Explain Plan, so the answer is correct”
“This model is too complex to have a design document”
“It is impossible to unit test scientific code”
“The lift from the direct mail campaign is 10%”
Benjamin S. Skrainka Tune up your data science process February 10, 2016 2 / 24
Correctness matters
Bad (data) science:
Costs real money and can kill people
Will eventually damage your reputation and career
Could expose you to litigation
An issue of basic integrity and sleeping at night
Benjamin S. Skrainka Tune up your data science process February 10, 2016 3 / 24
Objectives
Today’s goals:
Introduce VV&UQ framework to evaluate correctness of scientific
models
Survey good habits to improve quality of your work
Benjamin S. Skrainka Tune up your data science process February 10, 2016 4 / 24
Verification, Validation, & Uncertainty Quantification
Benjamin S. Skrainka Tune up your data science process February 10, 2016 5 / 24
Introduction to VV&UQ
Verification, Validation, & Uncertainty Quantification provides
epistemological framework to evaluate correctness of scientific models:
Evidence of correctness should accompany any prediction
In absence of evidence, assume predictions are wrong
Popper: can only disprove or fail to disprove a model
VV&UQ is inductive whereas science is deductive
Reference: Verification and Validation in Scientific Computing by
Oberkampf & Roy
Benjamin S. Skrainka Tune up your data science process February 10, 2016 6 / 24
Definitions of VV&UQ
Definitions of terms (Oberkampf & Roy):
Verification:
“solving equations right”
I.e., code implements the model correctly
Validation:
“solving right equations”
I.e., model has high fidelity to reality
Definitions of VV&UQ will vary depending on source . . .
→ Most organizations do not even practice verification. . .
Benjamin S. Skrainka Tune up your data science process February 10, 2016 7 / 24
Definition of UQ
Definition of Uncertainty Quantification (Oberkampf & Roy):
Process of identifying, characterizing, and quantifying those
factors in an analysis which could affect accuracy of
computational results
Do your assumptions hold? When do they fail?
Does your model apply to the data/situation?
Where does your model break down? What are its limits?
Benjamin S. Skrainka Tune up your data science process February 10, 2016 8 / 24
Verification of code
Does your code implement the model correctly?
Unit test everything you can:
Scientific code can be unit tested
Test special cases
Test on cases with analytic solutions
Test on synthetic data
Unit test framework will setup and tear-down fixtures
Should be able to recover parameters from Monte Carlo data
Benjamin S. Skrainka Tune up your data science process February 10, 2016 9 / 24
Verification of SQL
Passing Explain Plan doesn’t mean your SQL is correct:
Garbage in, garbage out
Check a simple case you can compute by hand
Check join plan is correct
Check aggregate statistics
Check answer is compatible with reality
Benjamin S. Skrainka Tune up your data science process February 10, 2016 10 / 24
Unit test
import unittest2 as unittest
import assignment as problems
class TestAssignment(unittest.TestCase):
def test_zero(self):
result = problems.question_zero()
self.assertEqual(result, 9198)
...
if __name__ == '__main__':
unittest.main()
Benjamin S. Skrainka Tune up your data science process February 10, 2016 11 / 24
Unit test
Figure 1:Benjamin S. Skrainka Tune up your data science process February 10, 2016 12 / 24
Validation of model
Check your model is a good (enough) representation of reality:
“All models are wrong but some are useful” – George Box
Run an experiment
Perform specification testing
Test assumptions hold
Beware of endogenous features
Benjamin S. Skrainka Tune up your data science process February 10, 2016 13 / 24
Approaches to experimentation
Many ways to test:
A/B test
Multi-armed bandit
Bayesian A/B test
Wald sequential analysis
Benjamin S. Skrainka Tune up your data science process February 10, 2016 14 / 24
Uncertainty quantification
There are many types of uncertainty which affect the robustness of your
model:
Parameter uncertainty
Structural uncertainty
Algorithmic uncertainty
Experimental uncertainty
Interpolation uncertainty
Classified as aleatoric (statistical) and epistemic (systematic)
Benjamin S. Skrainka Tune up your data science process February 10, 2016 15 / 24
Good habits
Benjamin S. Skrainka Tune up your data science process February 10, 2016 16 / 24
Act like a software engineer
Use best practices from software engineering:
Good design of code
Follow a sensible coding convention
Version control
Use same file structure for every project
Unit test
Use PEP8 or equivalent
Perform code reviews
Benjamin S. Skrainka Tune up your data science process February 10, 2016 17 / 24
Reproducible research
‘Document what you do and do what you document’:
Keep a journal!
Data provenance
How data was cleaned
Design document
Specification & requirements
Do you keep a journal? You should. Fermi taught me that. –
John A. Wheeler
Benjamin S. Skrainka Tune up your data science process February 10, 2016 18 / 24
Follow a workflow
Use a workflow like CRISP-DM:
1 Define business question and metric
2 Understand data
3 Prepare data
4 Build model
5 Evaluate
6 Deploy
Ensures you don’t forget any key steps
Benjamin S. Skrainka Tune up your data science process February 10, 2016 19 / 24
Automate your data pipeline
One-touch build of your application or paper:
Automate entire workflow from raw data to final result
Ensures you perform all steps
Ensures all steps are known – no one off manual adjustments
Avoids stupid human errors
Auto generate all tables and figures
Save time when handling new data . . . which always has subtle
changes in formatting
Benjamin S. Skrainka Tune up your data science process February 10, 2016 20 / 24
Write flexible code to handle data
Use constants/macros to access data fields:
Code will clearly show what data matters
Easier to understand code and data pipeline
Easier to debug data problems
Easier to handles changes in data formatting
Benjamin S. Skrainka Tune up your data science process February 10, 2016 21 / 24
Python example
# Setup indicators
ix_gdp = 7
...
# Load & clean data
m_raw = np.recfromcsv('bea_gdp.csv')
gdp = m_raw[:, ix_gdp]
...
Benjamin S. Skrainka Tune up your data science process February 10, 2016 22 / 24
Politics. . .
Often, there is political pressure to violate best practice:
Examples:
80% confidence intervals
Absurd attribution window
Two year forecast horizon but only three months of data
Hard to do right thing vs. senior management
Recruit a high-level scientist to advocate
Particularly common with forecasting:
Often requested by management for CYA
Insist on a ‘panel of experts’ for impossible decisions
Benjamin S. Skrainka Tune up your data science process February 10, 2016 23 / 24
Conclusion
Need to raise the quality of data science:
VV & UQ provides rigorous framework:
Verification: solve the equations right
Validation: solve the right equations
Uncertainty quantification: how robust is model to unknowns?
Adopting good habits provides huge gains for minimal effort
Benjamin S. Skrainka Tune up your data science process February 10, 2016 24 / 24

More Related Content

What's hot (19)

PDF
Why the EPV≥10 sample size rule is rubbish and what to use instead
Maarten van Smeden
 
PDF
Development and evaluation of prediction models: pitfalls and solutions
Maarten van Smeden
 
PDF
CRISP-DM - Agile Approach To Data Mining Projects
Michał Łopuszyński
 
PDF
International Year of Statistics | 2013
SCA - Hygiene and Forest Products Company
 
PDF
Prediction, Big Data, and AI: Steyerberg, Basel Nov 1, 2019
Ewout Steyerberg
 
PPTX
Causal discovery
dagunisa
 
PPTX
Calibration of risk prediction models: decision making with the lights on or ...
BenVanCalster
 
PDF
Filling the gaps in translational research
Paul Agapow
 
PPTX
Lecture 01 - Some basic terminology, History, Application of statistics - Def...
National College of Business Administration & Economics ( NCBA&E)
 
PDF
Introduction to prediction modelling - Berlin 2018 - Part II
Maarten van Smeden
 
DOC
Stayer mat 510 final exam2
shyaminfo15
 
PDF
Machine learning in medicine: calm down
BenVanCalster
 
PPTX
Stout Healthcare Analytics Midwestern University
Dr. Chris Stout
 
PPTX
Medical data diagnosis
Bhargav Srinivasan
 
DOC
Stayer mat 510 final exam2
vikscarter
 
DOCX
Spring 2016
Jean Ramirez
 
PDF
Avito recsys-challenge-2016RecSys Challenge 2016: Job Recommendation Based on...
Vasily Leksin
 
PPTX
Statistics Assignment Help
hwmsocial
 
PPT
10NTC - Data Superheroes - DiJulio
sarahdijulio
 
Why the EPV≥10 sample size rule is rubbish and what to use instead
Maarten van Smeden
 
Development and evaluation of prediction models: pitfalls and solutions
Maarten van Smeden
 
CRISP-DM - Agile Approach To Data Mining Projects
Michał Łopuszyński
 
International Year of Statistics | 2013
SCA - Hygiene and Forest Products Company
 
Prediction, Big Data, and AI: Steyerberg, Basel Nov 1, 2019
Ewout Steyerberg
 
Causal discovery
dagunisa
 
Calibration of risk prediction models: decision making with the lights on or ...
BenVanCalster
 
Filling the gaps in translational research
Paul Agapow
 
Lecture 01 - Some basic terminology, History, Application of statistics - Def...
National College of Business Administration & Economics ( NCBA&E)
 
Introduction to prediction modelling - Berlin 2018 - Part II
Maarten van Smeden
 
Stayer mat 510 final exam2
shyaminfo15
 
Machine learning in medicine: calm down
BenVanCalster
 
Stout Healthcare Analytics Midwestern University
Dr. Chris Stout
 
Medical data diagnosis
Bhargav Srinivasan
 
Stayer mat 510 final exam2
vikscarter
 
Spring 2016
Jean Ramirez
 
Avito recsys-challenge-2016RecSys Challenge 2016: Job Recommendation Based on...
Vasily Leksin
 
Statistics Assignment Help
hwmsocial
 
10NTC - Data Superheroes - DiJulio
sarahdijulio
 

Viewers also liked (20)

PPTX
Analysis, data & process modeling
Chi D. Nguyen
 
PDF
Cross border - off-shoring and outsourcing privacy sensitive data
Ulf Mattsson
 
PPT
Data science training in hyderabad
Kelly Technologies
 
PDF
Statistical analysis of process data 7 stages oil flow chart power point temp...
SlideTeam.net
 
PPTX
Data Science and Goodhart's Law
Domino Data Lab
 
PPTX
Data Wrangling and Oracle Connectors for Hadoop
Gwen (Chen) Shapira
 
PPTX
A Tour of the Data Science Process, a Case Study Using Movie Industry Data
Domino Data Lab
 
PDF
Data Analysis - Making Big Data Work
David Chiu
 
PDF
How to read a data model
sanksh
 
PPTX
Build a predictive analytics model on a terabyte of data within hours
DataWorks Summit
 
PDF
pandas: a Foundational Python Library for Data Analysis and Statistics
Wes McKinney
 
PDF
The data model is dead, long live the data model
Patrick McFadin
 
PDF
Python Data Wrangling: Preparing for the Future
Wes McKinney
 
PDF
pandas: Powerful data analysis tools for Python
Wes McKinney
 
PDF
Building a Predictive Model
DKALab
 
PDF
UX x Analytics: Love or hate
Christian Rohr
 
PDF
Python for Financial Data Analysis with pandas
Wes McKinney
 
PDF
Improving Python and Spark (PySpark) Performance and Interoperability
Wes McKinney
 
PDF
Analytics>Forward - Design Thinking for Data Science
Zeydy Ortiz, Ph. D.
 
PDF
Lessons in Data Modeling: Why a Data Model is an Important Part of Your Data ...
DATAVERSITY
 
Analysis, data & process modeling
Chi D. Nguyen
 
Cross border - off-shoring and outsourcing privacy sensitive data
Ulf Mattsson
 
Data science training in hyderabad
Kelly Technologies
 
Statistical analysis of process data 7 stages oil flow chart power point temp...
SlideTeam.net
 
Data Science and Goodhart's Law
Domino Data Lab
 
Data Wrangling and Oracle Connectors for Hadoop
Gwen (Chen) Shapira
 
A Tour of the Data Science Process, a Case Study Using Movie Industry Data
Domino Data Lab
 
Data Analysis - Making Big Data Work
David Chiu
 
How to read a data model
sanksh
 
Build a predictive analytics model on a terabyte of data within hours
DataWorks Summit
 
pandas: a Foundational Python Library for Data Analysis and Statistics
Wes McKinney
 
The data model is dead, long live the data model
Patrick McFadin
 
Python Data Wrangling: Preparing for the Future
Wes McKinney
 
pandas: Powerful data analysis tools for Python
Wes McKinney
 
Building a Predictive Model
DKALab
 
UX x Analytics: Love or hate
Christian Rohr
 
Python for Financial Data Analysis with pandas
Wes McKinney
 
Improving Python and Spark (PySpark) Performance and Interoperability
Wes McKinney
 
Analytics>Forward - Design Thinking for Data Science
Zeydy Ortiz, Ph. D.
 
Lessons in Data Modeling: Why a Data Model is an Important Part of Your Data ...
DATAVERSITY
 
Ad

Similar to Tune up your data science process (20)

PDF
Correctness in Data Science - Data Science Pop-up Seattle
Domino Data Lab
 
PPTX
No estimates - 10 new principles for testing
Vasco Duarte
 
PDF
Challenges in Analytics for BIG Data
Prasant Misra
 
PPTX
Tips and Tricks to be an Effective Data Scientist
Lisa Cohen
 
PDF
Challenges of Executing AI
Dr. Umesh Rao.Hodeghatta
 
PDF
Understanding-the-Data-Science-Lifecycle
Ozias Rondon
 
PDF
Data Science For Beginners | Who Is A Data Scientist? | Data Science Tutorial...
Edureka!
 
PDF
Machine Learning & IT Service Intelligence for the Enterprise: The Future is ...
Precisely
 
PDF
Navy security contest-bigdataforsecurity
stelligence
 
PDF
Claudia Gold: Learning Data Science Online
sfdatascience
 
PDF
Barga Data Science lecture 2
Roger Barga
 
PPTX
MLOps and Data Quality: Deploying Reliable ML Models in Production
Provectus
 
PDF
CRISP-DM Agile Approach to Data Mining Projects
Data Science Warsaw
 
PDF
Exploring the Data science Process
Vishal Patel
 
PPTX
Predictive Model and Record Description with Segmented Sensitivity Analysis (...
Greg Makowski
 
PDF
DataAnalyticsLC_20180410_public
plka13
 
PPT
CS583-intro Data Mining Primitives, Languages and System Architecture
fatimaezzahraboumaiz2
 
PPT
Data mining is the statistical technique of processing raw data in a structur...
ssuser6478a8
 
PDF
Disrupting Risk Management through Emerging Technologies
Databricks
 
PPTX
ANIn Coimbatore _ April 2025 | Why data is important and how synthetic data c...
AgileNetwork
 
Correctness in Data Science - Data Science Pop-up Seattle
Domino Data Lab
 
No estimates - 10 new principles for testing
Vasco Duarte
 
Challenges in Analytics for BIG Data
Prasant Misra
 
Tips and Tricks to be an Effective Data Scientist
Lisa Cohen
 
Challenges of Executing AI
Dr. Umesh Rao.Hodeghatta
 
Understanding-the-Data-Science-Lifecycle
Ozias Rondon
 
Data Science For Beginners | Who Is A Data Scientist? | Data Science Tutorial...
Edureka!
 
Machine Learning & IT Service Intelligence for the Enterprise: The Future is ...
Precisely
 
Navy security contest-bigdataforsecurity
stelligence
 
Claudia Gold: Learning Data Science Online
sfdatascience
 
Barga Data Science lecture 2
Roger Barga
 
MLOps and Data Quality: Deploying Reliable ML Models in Production
Provectus
 
CRISP-DM Agile Approach to Data Mining Projects
Data Science Warsaw
 
Exploring the Data science Process
Vishal Patel
 
Predictive Model and Record Description with Segmented Sensitivity Analysis (...
Greg Makowski
 
DataAnalyticsLC_20180410_public
plka13
 
CS583-intro Data Mining Primitives, Languages and System Architecture
fatimaezzahraboumaiz2
 
Data mining is the statistical technique of processing raw data in a structur...
ssuser6478a8
 
Disrupting Risk Management through Emerging Technologies
Databricks
 
ANIn Coimbatore _ April 2025 | Why data is important and how synthetic data c...
AgileNetwork
 
Ad

Recently uploaded (20)

PPTX
ER_Model_with_Diagrams_Presentation.pptx
dharaadhvaryu1992
 
PPTX
GenAI-Introduction-to-Copilot-for-Bing-March-2025-FOR-HUB.pptx
cleydsonborges1
 
PPTX
apidays Helsinki & North 2025 - Vero APIs - Experiences of API development in...
apidays
 
PDF
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 
PPTX
apidays Helsinki & North 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (A...
apidays
 
PPTX
Module-5-Measures-of-Central-Tendency-Grouped-Data-1.pptx
lacsonjhoma0407
 
PPT
deep dive data management sharepoint apps.ppt
novaprofk
 
PDF
apidays Helsinki & North 2025 - How (not) to run a Graphql Stewardship Group,...
apidays
 
PDF
AUDITABILITY & COMPLIANCE OF AI SYSTEMS IN HEALTHCARE
GAHI Youssef
 
PPTX
apidays Singapore 2025 - Designing for Change, Julie Schiller (Google)
apidays
 
PDF
Merits and Demerits of DBMS over File System & 3-Tier Architecture in DBMS
MD RIZWAN MOLLA
 
PDF
Data Chunking Strategies for RAG in 2025.pdf
Tamanna
 
PPTX
Climate Action.pptx action plan for climate
justfortalabat
 
PDF
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
PDF
What does good look like - CRAP Brighton 8 July 2025
Jan Kierzyk
 
PDF
Context Engineering for AI Agents, approaches, memories.pdf
Tamanna
 
PPTX
apidays Helsinki & North 2025 - Running a Successful API Program: Best Practi...
apidays
 
PDF
apidays Helsinki & North 2025 - API-Powered Journeys: Mobility in an API-Driv...
apidays
 
PPTX
Advanced_NLP_with_Transformers_PPT_final 50.pptx
Shiwani Gupta
 
PDF
How to Connect Your On-Premises Site to AWS Using Site-to-Site VPN.pdf
Tamanna
 
ER_Model_with_Diagrams_Presentation.pptx
dharaadhvaryu1992
 
GenAI-Introduction-to-Copilot-for-Bing-March-2025-FOR-HUB.pptx
cleydsonborges1
 
apidays Helsinki & North 2025 - Vero APIs - Experiences of API development in...
apidays
 
The European Business Wallet: Why It Matters and How It Powers the EUDI Ecosy...
Lal Chandran
 
apidays Helsinki & North 2025 - Agentic AI: A Friend or Foe?, Merja Kajava (A...
apidays
 
Module-5-Measures-of-Central-Tendency-Grouped-Data-1.pptx
lacsonjhoma0407
 
deep dive data management sharepoint apps.ppt
novaprofk
 
apidays Helsinki & North 2025 - How (not) to run a Graphql Stewardship Group,...
apidays
 
AUDITABILITY & COMPLIANCE OF AI SYSTEMS IN HEALTHCARE
GAHI Youssef
 
apidays Singapore 2025 - Designing for Change, Julie Schiller (Google)
apidays
 
Merits and Demerits of DBMS over File System & 3-Tier Architecture in DBMS
MD RIZWAN MOLLA
 
Data Chunking Strategies for RAG in 2025.pdf
Tamanna
 
Climate Action.pptx action plan for climate
justfortalabat
 
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
What does good look like - CRAP Brighton 8 July 2025
Jan Kierzyk
 
Context Engineering for AI Agents, approaches, memories.pdf
Tamanna
 
apidays Helsinki & North 2025 - Running a Successful API Program: Best Practi...
apidays
 
apidays Helsinki & North 2025 - API-Powered Journeys: Mobility in an API-Driv...
apidays
 
Advanced_NLP_with_Transformers_PPT_final 50.pptx
Shiwani Gupta
 
How to Connect Your On-Premises Site to AWS Using Site-to-Site VPN.pdf
Tamanna
 

Tune up your data science process

  • 1. Tune up your data science process Benjamin S. Skrainka February 10, 2016 Benjamin S. Skrainka Tune up your data science process February 10, 2016 1 / 24
  • 2. The correctness problem A lot of (data) science is unscientific: “My code runs, so the answer must be correct” “It passed Explain Plan, so the answer is correct” “This model is too complex to have a design document” “It is impossible to unit test scientific code” “The lift from the direct mail campaign is 10%” Benjamin S. Skrainka Tune up your data science process February 10, 2016 2 / 24
  • 3. Correctness matters Bad (data) science: Costs real money and can kill people Will eventually damage your reputation and career Could expose you to litigation An issue of basic integrity and sleeping at night Benjamin S. Skrainka Tune up your data science process February 10, 2016 3 / 24
  • 4. Objectives Today’s goals: Introduce VV&UQ framework to evaluate correctness of scientific models Survey good habits to improve quality of your work Benjamin S. Skrainka Tune up your data science process February 10, 2016 4 / 24
  • 5. Verification, Validation, & Uncertainty Quantification Benjamin S. Skrainka Tune up your data science process February 10, 2016 5 / 24
  • 6. Introduction to VV&UQ Verification, Validation, & Uncertainty Quantification provides epistemological framework to evaluate correctness of scientific models: Evidence of correctness should accompany any prediction In absence of evidence, assume predictions are wrong Popper: can only disprove or fail to disprove a model VV&UQ is inductive whereas science is deductive Reference: Verification and Validation in Scientific Computing by Oberkampf & Roy Benjamin S. Skrainka Tune up your data science process February 10, 2016 6 / 24
  • 7. Definitions of VV&UQ Definitions of terms (Oberkampf & Roy): Verification: “solving equations right” I.e., code implements the model correctly Validation: “solving right equations” I.e., model has high fidelity to reality Definitions of VV&UQ will vary depending on source . . . → Most organizations do not even practice verification. . . Benjamin S. Skrainka Tune up your data science process February 10, 2016 7 / 24
  • 8. Definition of UQ Definition of Uncertainty Quantification (Oberkampf & Roy): Process of identifying, characterizing, and quantifying those factors in an analysis which could affect accuracy of computational results Do your assumptions hold? When do they fail? Does your model apply to the data/situation? Where does your model break down? What are its limits? Benjamin S. Skrainka Tune up your data science process February 10, 2016 8 / 24
  • 9. Verification of code Does your code implement the model correctly? Unit test everything you can: Scientific code can be unit tested Test special cases Test on cases with analytic solutions Test on synthetic data Unit test framework will setup and tear-down fixtures Should be able to recover parameters from Monte Carlo data Benjamin S. Skrainka Tune up your data science process February 10, 2016 9 / 24
  • 10. Verification of SQL Passing Explain Plan doesn’t mean your SQL is correct: Garbage in, garbage out Check a simple case you can compute by hand Check join plan is correct Check aggregate statistics Check answer is compatible with reality Benjamin S. Skrainka Tune up your data science process February 10, 2016 10 / 24
  • 11. Unit test import unittest2 as unittest import assignment as problems class TestAssignment(unittest.TestCase): def test_zero(self): result = problems.question_zero() self.assertEqual(result, 9198) ... if __name__ == '__main__': unittest.main() Benjamin S. Skrainka Tune up your data science process February 10, 2016 11 / 24
  • 12. Unit test Figure 1:Benjamin S. Skrainka Tune up your data science process February 10, 2016 12 / 24
  • 13. Validation of model Check your model is a good (enough) representation of reality: “All models are wrong but some are useful” – George Box Run an experiment Perform specification testing Test assumptions hold Beware of endogenous features Benjamin S. Skrainka Tune up your data science process February 10, 2016 13 / 24
  • 14. Approaches to experimentation Many ways to test: A/B test Multi-armed bandit Bayesian A/B test Wald sequential analysis Benjamin S. Skrainka Tune up your data science process February 10, 2016 14 / 24
  • 15. Uncertainty quantification There are many types of uncertainty which affect the robustness of your model: Parameter uncertainty Structural uncertainty Algorithmic uncertainty Experimental uncertainty Interpolation uncertainty Classified as aleatoric (statistical) and epistemic (systematic) Benjamin S. Skrainka Tune up your data science process February 10, 2016 15 / 24
  • 16. Good habits Benjamin S. Skrainka Tune up your data science process February 10, 2016 16 / 24
  • 17. Act like a software engineer Use best practices from software engineering: Good design of code Follow a sensible coding convention Version control Use same file structure for every project Unit test Use PEP8 or equivalent Perform code reviews Benjamin S. Skrainka Tune up your data science process February 10, 2016 17 / 24
  • 18. Reproducible research ‘Document what you do and do what you document’: Keep a journal! Data provenance How data was cleaned Design document Specification & requirements Do you keep a journal? You should. Fermi taught me that. – John A. Wheeler Benjamin S. Skrainka Tune up your data science process February 10, 2016 18 / 24
  • 19. Follow a workflow Use a workflow like CRISP-DM: 1 Define business question and metric 2 Understand data 3 Prepare data 4 Build model 5 Evaluate 6 Deploy Ensures you don’t forget any key steps Benjamin S. Skrainka Tune up your data science process February 10, 2016 19 / 24
  • 20. Automate your data pipeline One-touch build of your application or paper: Automate entire workflow from raw data to final result Ensures you perform all steps Ensures all steps are known – no one off manual adjustments Avoids stupid human errors Auto generate all tables and figures Save time when handling new data . . . which always has subtle changes in formatting Benjamin S. Skrainka Tune up your data science process February 10, 2016 20 / 24
  • 21. Write flexible code to handle data Use constants/macros to access data fields: Code will clearly show what data matters Easier to understand code and data pipeline Easier to debug data problems Easier to handles changes in data formatting Benjamin S. Skrainka Tune up your data science process February 10, 2016 21 / 24
  • 22. Python example # Setup indicators ix_gdp = 7 ... # Load & clean data m_raw = np.recfromcsv('bea_gdp.csv') gdp = m_raw[:, ix_gdp] ... Benjamin S. Skrainka Tune up your data science process February 10, 2016 22 / 24
  • 23. Politics. . . Often, there is political pressure to violate best practice: Examples: 80% confidence intervals Absurd attribution window Two year forecast horizon but only three months of data Hard to do right thing vs. senior management Recruit a high-level scientist to advocate Particularly common with forecasting: Often requested by management for CYA Insist on a ‘panel of experts’ for impossible decisions Benjamin S. Skrainka Tune up your data science process February 10, 2016 23 / 24
  • 24. Conclusion Need to raise the quality of data science: VV & UQ provides rigorous framework: Verification: solve the equations right Validation: solve the right equations Uncertainty quantification: how robust is model to unknowns? Adopting good habits provides huge gains for minimal effort Benjamin S. Skrainka Tune up your data science process February 10, 2016 24 / 24