Bad Data Handbook

Book description

What is bad data? Some people consider it a technical phenomenon, like missing values or malformed records, but bad data includes a lot more. In this handbook, data expert Q. Ethan McCallum has gathered 19 colleagues from every corner of the data arena to reveal how they’ve recovered from nasty data problems.

From cranky storage to poor representation to misguided policy, there are many paths to bad data. Bottom line? Bad data is data that gets in the way. This book explains effective ways to get around it.

Among the many topics covered, you’ll discover how to:

  • Test drive your data to see if it’s ready for analysis
  • Work spreadsheet data into a usable form
  • Handle encoding problems that lurk in text data
  • Develop a successful web-scraping effort
  • Use NLP tools to reveal the real sentiment of online reviews
  • Address cloud computing issues that can impact your analysis effort
  • Avoid policies that create data analysis roadblocks
  • Take a systematic approach to data quality analysis

Table of contents

  1. Bad Data Handbook
  2. SPECIAL OFFER: Upgrade this ebook with O’Reilly
  3. About the Authors
  4. Preface
    1. Conventions Used in This Book
    2. Using Code Examples
    3. Safari® Books Online
    4. How to Contact Us
    5. Acknowledgments
  5. 1. Setting the Pace: What Is Bad Data?
  6. 2. Is It Just Me, or Does This Data Smell Funny?
    1. Understand the Data Structure
    2. Field Validation
    3. Value Validation
    4. Physical Interpretation of Simple Statistics
    5. Visualization
    6. Keyword PPC Example
    7. Search Referral Example
    8. Recommendation Analysis
    9. Time Series Data
    10. Conclusion
  7. 3. Data Intended for Human Consumption, Not Machine Consumption
    1. The Data
    2. The Problem: Data Formatted for Human Consumption
      1. The Arrangement of Data
      2. Data Spread Across Multiple Files
    3. The Solution: Writing Code
      1. Reading Data from an Awkward Format
      2. Reading Data Spread Across Several Files
    4. Postscript
    5. Other Formats
    6. Summary
  8. 4. Bad Data Lurking in Plain Text
    1. Which Plain Text Encoding?
    2. Guessing Text Encoding
    3. Normalizing Text
    4. Problem: Application-Specific Characters Leaking into Plain Text
    5. Text Processing with Python
    6. Exercises
  9. 5. (Re)Organizing the Web’s Data
    1. Can You Get That?
    2. General Workflow Example
      1. robots.txt
      2. Identifying the Data Organization Pattern
      3. Store Offline Version for Parsing
      4. Scrape the Information Off the Page
    3. The Real Difficulties
      1. Download the Raw Content If Possible
      2. Forms, Dialog Boxes, and New Windows
      3. Flash
    4. The Dark Side
    5. Conclusion
  10. 6. Detecting Liars and the Confused in Contradictory Online Reviews
    1. Weotta
    2. Getting Reviews
    3. Sentiment Classification
    4. Polarized Language
    5. Corpus Creation
    6. Training a Classifier
    7. Validating the Classifier
    8. Designing with Data
    9. Lessons Learned
    10. Summary
    11. Resources
  11. 7. Will the Bad Data Please Stand Up?
    1. Example 1: Defect Reduction in Manufacturing
    2. Example 2: Who’s Calling?
    3. Example 3: When “Typical” Does Not Mean “Average”
    4. Lessons Learned
    5. Will This Be on the Test?
  12. 8. Blood, Sweat, and Urine
    1. A Very Nerdy Body Swap Comedy
    2. How Chemists Make Up Numbers
    3. All Your Database Are Belong to Us
    4. Check, Please
    5. Live Fast, Die Young, and Leave a Good-Looking Corpse Code Repository
    6. Rehab for Chemists (and Other Spreadsheet Abusers)
    7. tl;dr
  13. 9. When Data and Reality Don’t Match
    1. Whose Ticker Is It Anyway?
    2. Splits, Dividends, and Rescaling
    3. Bad Reality
    4. Conclusion
  14. 10. Subtle Sources of Bias and Error
    1. Imputation Bias: General Issues
    2. Reporting Errors: General Issues
    3. Other Sources of Bias
      1. Topcoding/Bottomcoding
      2. Seam Bias
      3. Proxy Reporting
      4. Sample Selection
    4. Conclusions
    5. References 
  15. 11. Don’t Let the Perfect Be the Enemy of the Good: Is Bad Data Really Bad?
    1. But First, Let’s Reflect on Graduate School …
    2. Moving On to the Professional World
    3. Moving into Government Work
    4. Government Data Is Very Real
    5. Service Call Data as an Applied Example
    6. Moving Forward
    7. Lessons Learned and Looking Ahead
  16. 12. When Databases Attack: A Guide for When to Stick to Files
    1. History
      1. Building My Toolset
      2. The Roadblock: My Datastore
    2. Consider Files as Your Datastore
      1. Files Are Simple!
      2. Files Work with Everything
      3. Files Can Contain Any Data Type
      4. Data Corruption Is Local
      5. They Have Great Tooling
      6. There’s No Install Tax
    3. File Concepts
      1. Encoding
      2. Text Files
      3. Binary Data
      4. Memory-Mapped Files
      5. File Formats
      6. Delimiters
    4. A Web Framework Backed by Files
      1. Motivation
      2. Implementation
    5. Reflections
  17. 13. Crouching Table, Hidden Network
    1. A Relational Cost Allocations Model
    2. The Delicate Sound of a Combinatorial Explosion…
    3. The Hidden Network Emerges
    4. Storing the Graph
    5. Navigating the Graph with Gremlin
    6. Finding Value in Network Properties
    7. Think in Terms of Multiple Data Models and Use the Right Tool for the Job
    8. Acknowledgments
  18. 14. Myths of Cloud Computing
    1. Introduction to the Cloud
    2. What Is “The Cloud”?
    3. The Cloud and Big Data
    4. Introducing Fred
    5. At First Everything Is Great
    6. They Put 100% of Their Infrastructure in the Cloud
    7. As Things Grow, They Scale Easily at First
    8. Then Things Start Having Trouble
    9. They Need to Improve Performance
    10. Higher IO Becomes Critical
    11. A Major Regional Outage Causes Massive Downtime
    12. Higher IO Comes with a Cost
    13. Data Sizes Increase
    14. Geo Redundancy Becomes a Priority
    15. Horizontal Scale Isn’t as Easy as They Hoped
    16. Costs Increase Dramatically
    17. Fred’s Follies
    18. Myth 1: Cloud Is a Great Solution for All Infrastructure Components
      1. How This Myth Relates to Fred’s Story
    19. Myth 2: Cloud Will Save Us Money
      1. How This Myth Relates to Fred’s Story
    20. Myth 3: Cloud IO Performance Can Be Improved to Acceptable Levels Through Software RAID
      1. How This Myth Relates to Fred’s Story
    21. Myth 4: Cloud Computing Makes Horizontal Scaling Easy
      1. How This Myth Relates to Fred’s Story
    22. Conclusion and Recommendations
  19. 15. The Dark Side of Data Science
    1. Avoid These Pitfalls
    2. Know Nothing About Thy Data
      1. Be Inconsistent in Cleaning and Organizing the Data
      2. Assume Data Is Correct and Complete
      3. Spillover of Time-Bound Data
    3. Thou Shalt Provide Your Data Scientists with a Single Tool for All Tasks
      1. Using a Production Environment for Ad-Hoc Analysis
      2. The Ideal Data Science Environment
    4. Thou Shalt Analyze for Analysis’ Sake Only
    5. Thou Shalt Compartmentalize Learnings
    6. Thou Shalt Expect Omnipotence from Data Scientists
      1. Where Do Data Scientists Live Within the Organization?
    7. Final Thoughts
  20. 16. How to Feed and Care for Your Machine-Learning Experts
    1. Define the Problem
    2. Fake It Before You Make It
    3. Create a Training Set
    4. Pick the Features
    5. Encode the Data
    6. Split Into Training, Test, and Solution Sets
    7. Describe the Problem
    8. Respond to Questions
    9. Integrate the Solutions
    10. Conclusion
  21. 17. Data Traceability
    1. Why?
    2. Personal Experience
      1. Snapshotting
      2. Saving the Source
      3. Weighting Sources
      4. Backing Out Data
      5. Separating Phases (and Keeping them Pure)
      6. Identifying the Root Cause
      7. Finding Areas for Improvement
    3. Immutability: Borrowing an Idea from Functional Programming
    4. An Example
      1. Crawlers
      2. Change
      3. Clustering
      4. Popularity
    5. Conclusion
  22. 18. Social Media: Erasable Ink?
    1. Social Media: Whose Data Is This Anyway?
    2. Control
    3. Commercial Resyndication
    4. Expectations Around Communication and Expression
    5. Technical Implications of New End User Expectations
    6. What Does the Industry Do?
      1. Validation API
      2. Update Notification API
    7. What Should End Users Do?
    8. How Do We Work Together?
  23. 19. Data Quality Analysis Demystified: Knowing When Your Data Is Good Enough
    1. Framework Introduction: The Four Cs of Data Quality Analysis
    2. Complete
    3. Coherent
    4. Correct
    5. aCcountable
    6. Conclusion
  24. Index
  25. About the Author
  26. Colophon
  27. SPECIAL OFFER: Upgrade this ebook with O’Reilly
  28. Copyright

Product information

  • Title: Bad Data Handbook
  • Author(s): Q. Ethan McCallum
  • Release date: November 2012
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781449324971