JupyterLab, a flagship project from Jupyter, is one of the most popular and impactful open-source projects in Data Science. One of the great things about Jupyter ecosystem is that if there is something you are missing, there is either an open-source extension for that or you can create it yourself.
In this article, we’ll talk about JupyterLab extensions that can make your machine learning workflows better.
What is a JupyterLab Extension?
As folks from JupyterLab say:
“JupyterLab is designed as an extensible environment”.
JupyterLab extension is simply a plug-and-play add-on that makes more of the things you need possible.
How to manage JupyterLab extensions
There are a ton of JupyterLab extensions that you may want to use.
How do you manage all those extensions?
Extension Manager (little puzzle icon in the command palette) lets you install and disable extensions directly from JupyterLab. I highly recommend it.
And if your Extension Manager needs to be filled up with add-ons, take a look at our list of the best JupyterLab extensions for machine learning.
Best JupyterLab Extensions
We couldn’t talk about JupyterLab extensions for machine learning without mentioning the one that we built to help people keep track of experiments, data exploration, and error analysis that happens in the notebooks.
Neptune-notebooks extension lets you:
- Click a button to send or download notebook checkpoint to and from Neptune
- Compare checkpoints in Neptune and share them with the team.
Let me show you:
If it looks interesting check our docs.
JupyterLab TensorBoard is a frontend extension for tensorboard on jupyterlab :). It uses the jupyter_tensorboard project as a tensorboard backend. It helps to collaborate between jupyter notebook and tensorboard (a visualization tool for tensorflow) by providing a graphical user interface for tensorboard start, manage and stop in jupyter interface.
Here’s how it helps:
- No need to type tensorboard and the long log path in the command line.
- No need for an extra port to serve tensorboard—this is helpful for remote jupyter servers.
- Multiple tensorboard instances managing simultaneously.
The Best Tools for Machine Learning Model Visualization
The ML workspace is an all-in-one web-based integrated development environment dedicated for machine learning and data science.
It is simple to deploy and lets you productively build ML solutions on your own machines. This workspace is a universal solution for developers preloaded with a variety of popular data science libraries (e.g., Tensorflow, PyTorch, Keras, Sklearn) and dev tools (e.g., Jupyter, VS Code, Tensorboard) perfectly configured, optimized, and integrated.
System Monitor is a JupyterLab extension to display system information (memory and cpu usage). It allows you to monitor your own resource usage.
The extension gives you an insight into how much resources your current notebook server and its children (kernels, terminals, etc) are using so you can optimize your ML experiments and better manage work.
LSP (Language Server Protocol) is a JupyterLab extension that enables inter-process communication to support multiple languages you may want to use.
LSP integration has several detailed but helpful features:
- Hover shows a tooltip with function/class signature, module documentation or any other piece of information that the language server provides
- Diagnostics—colors for critical errors, warnings, etc.
- Jump to definition—use the context menu entries to jump to definitions
- A highlight of references—all the usages will be highlighted when cursor is placed on a variable, function, etc.
- Automatic completion for certain characters when triggered
- Automatic signature suggestion
- Advanced static-analysis autocompletion without a running kernel
- Rename variables, functions and more, in both notebooks and the file editor
- Diagnostic panel
Debugger is a JupyterLab extension that works as a visual debugger for Jupyter notebooks, consoles, and source files. It can help you identify and fix bugs so your machine learning models can work properly.
You can use the kernelspy extension for JupyterLab to inspect debug messages sent between the debugger UI and the kernel.
JupyterLab debugger can also be helpful when you’re working with VS code as you can inspect the debug messages to understand when debuq requests are made and to compare the behavior of the JupyterLab debugger with the Python debugger in VS Code.
This one is a JupyterLab extension for Git—a free and open-source distributed version control system. It allows you for version controlling. You simply use it by opening the Git extension from the Git tab on the left panel.
This extension gives you flexibility in use as its behavior can be modified via different settings.
This extension adds a few Jupytext commands to the command palette. You can use it to select the desired ipynb/text pairing for your notebook. It’s a small functionality but can help you navigate through your notebooks.
nbgather is a JupyterLab extension that has tools for cleaning code, recovering lost code, and comparing versions of code in Jupyter Lab. The extension saves you a history of all code you’ve executed and the outputs it produces to the notebook’s metadata.
After you download the extension, you can clean and compare versions of your code.
nbgather is in an alpha stage of development, so it still may have some glitches. Anyway, it’s worth giving a shot if you want to have uncluttered and consistent notebooks.
Variable Inspector is a helpful extension for JupyterLab that shows currently used variables and their values. It’s inspired by the variable inspector extension for jupyter notebooks and by the inspector extension included in jupyterlab.
As for now, it’s still being developed, so you may experience some glitches. Here’s what you can do with it:
- Inspect variables for python consoles and notebooks
- Inspect matrices in a datagrid-viewer, however, it may not work for large matrices
- Inspect Jupyter Widgets inline and interactively
This JupyterLab extension gives you functionalities helpful in diffing and merging of Jupyter Notebooks. It understands the structure of notebook documents so it can make intelligent decisions when diffing and merging notebooks.
Here’s a short summary of the main features:
- Compare notebooks in a terminal-friendly way
- Merge notebooks in a three-way with automatic conflict resolution
- View a rich rendered diff of notebooks
- Have a web-based three-way merge tool for notebooks
- View a single notebook in a terminal-friendly way
Voyager is a JupyterLab MIME renderer extension to view CSV and JSON data in Voyager 2. It is a simple solution that allows you to visualize data.
This extension provides a bare minimum integration with Voyager.
12. JupyterLab LaTeX
LaTeX is a JupyterLab extension that lets you live-edit LaTeX documents.
The extension runs on xelatex on the server by default but you can customize the command by customizing jupyter_notebook_config.py file. When it comes to bibliography, it runs on bibtex but you can also customize it.
Another element that you can customize is the ability to run arbitrary code by triggering external shell commands.
13. JupyterLab HTML
This one is a JupyterLab extension mimerenderer to render HTML files in IFrame Tab. It lets you view rendered HTML by double-clicking on .html files in the file browser. Files are opened in a JupyterLab tab.
Plotly is a JupyterLab extension for rendering Plotly charts.
To watch for changes in the extension’s source and automatically rebuild the extension and application, you can watch the jupyter-renderers directory and run JupyterLab in watch mode.
15. JupyterLab bokeh
Another position on our list is a Jupyter extension for rendering Bokeh visualizations.
A Table of Contents extension for JupyterLab may not seem as much of a technical thing, but it can save you a lot of trouble when scrolling down and looking for information.
It auto-generates a table of contents in the left area when you have a notebook or markdown document open. The entries are clickable, and you can scroll the document to the heading in question.
Collapsible Headings is a helpful extension that lets you make headings collapsible. A selected header cell (i.e. markdown cell starting with some number of “#”) can be collapsed / uncollapsed by clicking on the caret icon created to the left of header cells or by using a shortcut.
18. Jupyter Dash
Jupyter Dash is a library that makes it easy to build Dash apps from Jupyter environments (e.g. classic Notebook, JupyterLab, Visual Studio Code notebooks, nteract, PyCharm notebooks, etc.).
It has many helpful features:
- Non-blocking execution
- Display modes: external, inline, JupyterLab
- Hot reloading: the ability to automatically update a running web application when changes are made to the application’s code.
- Error reporting: a small user interface to display errors that result from property validation failures and exceptions raised inside callbacks
- Jupyter Proxy Detection
- Production deployment
- Dash enterprise workspaces
19. JupyterLab SQL
The last one is a jupyterlab-sql extension that adds a SQL user interface to JupyterLab. It allows you to explore your tables with a point-and-click interface, and read and modify your database with custom queries.
The list of JupyterLab is quite extensive so there are many tools to choose from. You can use one, two, or all of them. Just make sure they’re not cluttering your Jupyter space and slow down processes.
Happy experimenting with extensions!
Get started with Neptune in 5 minutes
If you are looking for an experiment tracking tool you may want to take a look at Neptune.
It takes literally 5 minutes to set up and as one of our happy users said:
“Within the first few tens of runs, I realized how complete the tracking was – not just one or two numbers, but also the exact state of the code, the best-quality model snapshot stored to the cloud, the ability to quickly add notes on a particular experiment. My old methods were such a mess by comparison.” – Edward Dixon, Data Scientist @intel
To get started follow these 4 simple steps.
Install the client library.
pip install neptune-client
Connect to the tool by adding a snippet to your training code.
import neptune neptune.init(...) # credentials neptune.create_experiment() # start logger
Specify what you want to log:
neptune.log_metric('accuracy', 0.92) for prediction_image in worst_predictions: neptune.log_image('worst predictions', prediction_image)
Run your experiment as you normally would:
And that’s it!
Your experiment is logged to a central experiment database and displayed in the experiment dashboard, where you can search, compare, and drill down to whatever information you need.Get your free account ->