Joel Grus - The case against the jupyter notebook
Towards Data Science16 Heinä 2019

Joel Grus - The case against the jupyter notebook

To most data scientists, the jupyter notebook is a staple tool: it’s where they learned the ropes, it’s where they go to prototype models or explore their data — basically, it’s the default arena for their all their data science work.

But Joel Grus isn’t like most data scientists: he’s a former hedge fund manager and former Googler, and author of Data Science From Scratch. He currently works as a research engineer at the Allen Institute for Artificial Intelligence, and maintains a very active Twitter account.

Oh, and he thinks you should stop using Jupyter noteoboks. Now.

When you ask him why, he’ll provide many reasons, but a handful really stand out:

  • Hidden state: let’s say you define a variable like a = 1 in the first cell of your notebook. In a later cell, you assign it a new value, say a = 3 . This results is fairly predictable behavior as long as you run your notebook in order, from top to bottom. But if you don’t—or worse still, if you run the a = 3 cell and delete it later — it can be hard, or impossible to know from a simple inspection of the notebook what the true state of your variables is.
  • Replicability: one of the most important things to do to ensure that you’re running repeatable data science experiments is to write robust, modular code. Jupyter notebooks implicitly discourage this, because they’re not designed to be modularized (awkward hacks do allow you to import one notebook into another, but they’re, well, awkward). What’s more, to reproduce another person’s results, you need to first reproduce the environment in which their code was run. Vanilla notebooks don’t give you a good way to do that.
  • Bad for teaching: Jupyter notebooks make it very easy to write terrible tutorials — you know, the kind where you mindlessly hit “shift-enter” a whole bunch of times, and make your computer do a bunch of stuff that you don’t actually understand? It leads to a lot of frustrated learners, or even worse, a lot of beginners who think they understand how to code, but actually don’t.

Overall, Joel’s objections to Jupyter notebooks seem to come in large part from his somewhat philosophical view that data scientists should follow the same set of best practices that any good software engineers would. For instance, Joel stresses the importance of writing unit tests (even for data science code), and is a strong proponent of using type annotation (if you aren’t familiar with that, you should definitely learn about it here).

But even Joel thinks Jupyter notebooks have a place in data science: if you’re poking around at a pandas dataframe to do some basic exploratory data analysis, it’s hard to think of a better way to produce helpful plots on the fly than the trusty ol’ Jupyter notebook.

Whatever side of the Jupyter debate you’re on, it’s hard to deny that Joel makes some compelling points. I’m not personally shutting down my Jupyter kernel just yet, but I’m guessing I’ll be firing up my favorite IDE a bit more often in the future.

Tämä jakso on lisätty Podme-palveluun avoimen RSS-syötteen kautta eikä se ole Podmen omaa tuotantoa. Siksi jakso saattaa sisältää mainontaa.

Jaksot(130)

130. Edouard Harris - New Research: Advanced AI may tend to seek power *by default*

130. Edouard Harris - New Research: Advanced AI may tend to seek power *by default*

Progress in AI has been accelerating dramatically in recent years, and even months. It seems like every other day, there’s a new, previously-believed-to-be-impossible feat of AI that’s achieved by a w...

12 Loka 202258min

129. Amber Teng - Building apps with a new generation of language models

129. Amber Teng - Building apps with a new generation of language models

It’s no secret that a new generation of powerful and highly scaled language models is taking the world by storm. Companies like OpenAI, AI21Labs, and Cohere have built models so versatile that they’re...

5 Loka 202251min

128. David Hirko - AI observability and data as a cybersecurity weakness

128. David Hirko - AI observability and data as a cybersecurity weakness

Imagine you’re a big hedge fund, and you want to go out and buy yourself some data. Data is really valuable for you — it’s literally going to shape your investment decisions and determine your outcome...

28 Syys 202249min

127. Matthew Stewart - The emerging world of ML sensors

127. Matthew Stewart - The emerging world of ML sensors

Today, we live in the era of AI scaling. It seems like everywhere you look people are pushing to make large language models larger, or more multi-modal and leveraging ungodly amounts of processing pow...

21 Syys 202241min

126. JR King - Does the brain run on deep learning?

126. JR King - Does the brain run on deep learning?

Deep learning models — transformers in particular — are defining the cutting edge of AI today. They’re based on an architecture called an artificial neural network, as you probably already know if you...

14 Syys 202255min

125. Ryan Fedasiuk - Can the U.S. and China collaborate on AI safety?

125. Ryan Fedasiuk - Can the U.S. and China collaborate on AI safety?

It’s no secret that the US and China are geopolitical rivals. And it’s also no secret that that rivalry extends into AI — an area both countries consider to be strategically critical. But in a context...

7 Syys 202248min

124. Alex Watson - Synthetic data could change everything

124. Alex Watson - Synthetic data could change everything

There’s a website called thispersondoesnotexist.com. When you visit it, you’re confronted by a high-resolution, photorealistic AI-generated picture of a human face. As the website’s name suggests, the...

18 Touko 202251min

123. Ala Shaabana and Jacob Steeves - AI on the blockchain (it actually might just make sense)

123. Ala Shaabana and Jacob Steeves - AI on the blockchain (it actually might just make sense)

Two ML researchers with world-class pedigrees who decided to build a company that puts AI on the blockchain. Now to most people — myself included — “AI on the blockchain” sounds like a winning entry i...

12 Touko 202254min