1 of 13

Notebooks are not enough

Israel Herraiz

@herraiz

2 of 13

Data Science needs Software Engineering

Data Scientists are software writers.

Software Engineering is a mature discipline built on top of decades of bad experiences.

Let’s learn from history!

Let’s adopt Software Engineering best practices!

3 of 13

Have ever people died because Software Engineering best practices were ignored?

4 of 13

5 of 13

The Therac-25

Radiotherapy system.

Killed 4 people, and severely injured 2 more

6 of 13

The investigation concluded that (some of) the root causes were

  • No code reviews
  • No tests were conducted
  • Code copy-pasted from past projects
  • Bugs happened in corner cases

7 of 13

Notebooks in Data Science are popular

  • Straightforward creation of experiments
  • Easy sharing of experiments
  • Embedded graphics
  • Widgets for users to interact with the notebook

8 of 13

Notebooks are designed to to copy-paste share code, but not to be tested, and do not work well with Software Engineering tools

9 of 13

Think of the kittens

For every notebook with no tests, a kitten may die

10 of 13

I am a data scientist

Your testimony is a serious concern for my conscience.

Should I stop using notebooks?

How can I save more kittens?

11 of 13

You can keep using notebooks, for what they are good for.

Excellent for interactive computing

~100 kernels available

12 of 13

  • You are using version control and continuous integration (CI)
  • All code is reviewed and approved by another data scientist
  • No code is written without the corresponding test
  • Your project can be deployed from your repo
  • Feature decisions and bugs are logged in an issue tracking system
  • Your repo and the issue tracking are connected
  • Agree on coding guidelines, follow and measure as part of CI

The 10 7 commands of Software Engineering in Data Science

13 of 13

Can you do that with a notebook?

I find it hard to write substantial code in a notebook

http://mike.place/2016/notebook/

Jupyter Notebook is a fantastic tool that can be used in many different ways. [...] working with the Notebook on data science problems in a team setting can be challenging

https://svds.com/jupyter-notebook-best-practices-for-data-science/

version-control [..] can handle it quite well, but diff-comparing is a chore of unintelligible gibberish.

http://timstaley.co.uk/posts/making-git-and-jupyter-notebooks-play-nice/

Follow us at YoGen http://yogen.io/