This guide will show you how to:
Install neptune-notebook extension for Jupyter Notebook or JupyterLab
Connect Neptune to your Jupyter environment
Log your first notebook checkpoint to Neptune and see it in the UI
By the end of it, you will see your first notebook checkpoint in Neptune!
Make sure you meet the following prerequisites before starting:
Have Python 3.x installed
Have Jupyter Notebook or JupyterLab installed
Have node.js installed if you are using JupyterLab
To install neptune-notebooks on Jupyter Notebook:
Install neptune-notebooks extension:
pip install neptune-notebooks
Enable the extension for Jupyter Notebook:
jupyter nbextension enable --py neptune-notebooks
To install neptune-notebooks on JupyterLab go to your terminal and run:
jupyter labextension install neptune-notebooks
Remember that you need to have node.js installed to use JupyterLab extensions.
Create a notebook with some analysis in it.
For example, you can use this code to create an interactive Altair chart of the cars dataset
pip install altair vega_datasets
import altair as altfrom vega_datasets import datasource = data.cars()brush = alt.selection(type='interval')points = alt.Chart(source).mark_point().encode(x='Horsepower:Q',y='Miles_per_Gallon:Q',color=alt.condition(brush, 'Origin:N', alt.value('lightgray'))).add_selection(brush)bars = alt.Chart(source).mark_bar().encode(y='Origin:N',color='Origin:N',x='count(Origin):Q').transform_filter(brush)chart = points & barschart
Run both cells and see the interactive Altair visualization.
1) In Jupyter, click Connect to Neptune.
2) The Configure your connection to Neptune dialog appears.
2) Leave the dialog open and switch to the Neptune UI.
3) In the Neptune UI, obtain your API Token and copy it to the clipboard.
3.1) In the upper right corner, click the avatar, and then click Get API Token.
3.2) In the dialog that appears, click the Copy to clipboard button on the right. Then click Close.
4) Switch back to Jupyter. In the dialog you left open, paste the token you copied to the clipboard. Click Connect. A confirmation message is displayed. It contains a link through which you can go directly to this Notebook in Neptune.
Your API Token is private and unique. Never share it. It’s like sharing password.
Click on the Upload button.
You will be prompted to:
Choose which project you want to send this notebook to
Add a description of the notebook
Click on the green link that was created at the bottom of your notebook or go directly to the Notebooks section of your Neptune project.
Your notebook checkpoint was tracked and you can explore it now or later.
You’ve learned how to:
Install neptune-notebook extension for Jupyter Notebook or JupyterLab
Connect Neptune to your Jupyter environment
Log your first notebook checkpoint to Neptune and see it in the UI
Now that you know how to save notebook checkpoints to Neptune you can learn: