~/talk

Do Your Homework! Writing tests for Data Science and Stochastic Code

Talkat PyData DC 2018 · on Friday, 2018-11-16· [testing, developer-experience]
links:none on file
slides:none on file

Concrete method for testing nondeterministic code: write gold tests (human-labeled JSON examples), use Pytest examples with fixtures and xfail, and benchmark models over time. Implements random checks with scipy.stats normaltest (p‑value behavior noted) and an sklearn text-classification pipeline using SGD and grid search, recording a baseline score (example run gives p‑value 0.939 vs target 0.95). Generates HTML and coverage reports, compares plots via matplotlib, and keeps reproducible scripts to rerun and track regressions.

AI-written summary · about

  1. 0:00Testing Data Science code
  2. 1:04Homework teaches testing
  3. 3:10Test-driven mindset
  4. 4:55Benefits for data scientists
  5. 6:01Supply chain testing need
  6. 9:37Setting up pytest
  7. 12:27Basic unit tests
  8. 18:42Edge cases and validation
  9. 21:18Testing random outputs
  10. 25:20Stochastic ML models
  11. 30:15Advanced pytest features
  12. 34:11HTML reports and coverage
  13. 36:24Conclusion and next steps
  14. 37:04Q&A: Mocking datasets
  15. 38:30Q&A: Convincing teams
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.