T-SQL Tuesday #137: Using Notebooks Every Day

Another month, another blog party! Shout out to Steve (b|t) for hosting and choosing a great topic – this month we will be chatting about Jupiter notebooks and how we use them.

I discovered Jupiter notebooks not that long ago, but the more I use them the more I see how powerful they could be. For those of you who are not familiar whit Jupiter Notebook: It is an open-source web application where you can combine code, output, visualizations and explanatory text all in one document allowing you to write a code that tells a story. Now that you have an idea of what Jupiter notebook is I will walk you through how you can use it in Azure Machine Learning Studio.

But first thing first, to be able to use Jupiter notebooks in Azure Machine Learning Studio you should have an Azure Machine Learning workspace. You can easily do this from the Azure portal- Just search for Machine Learning in the “Create new resource” section and fill in the required information.

Now that you have your workspace created you will need to start Azure Machine Learning Studio. Go to the workspace overview page and click on the “Launch Studio” button.

Once you have Azure Machine Learning Studio open on the menu on the left you will see “Notebooks” under the Author section.

In the Netbooks window, you have two subsections. Under “File” you can create your own notebook by clicking on the  symbol and selecting “Create New File” which will prompt you to a window where you have to fill in the file name and choose the file type – one of the options being Notebook (*.ipynb).

To be able to run a notebook you have to point it to a Compute – if you already have a compute instance you can select it otherwise you can click on the plus and create a new Compute resource.

You can also use one of the sample notebooks – go to “Samples” and choose a sample notebook, but note that to work with it you will have to clone it first.

To edit an existing notebook just click on the cell you want to update. You don’t need to be connected to a compute instance to edit the notebook, however that is not valid if you want to run it.

When you create an ipynb file Azure Machine Learning creates a checkpoint file. Every notebook is autosaved every 30 seconds, however, that AutoSave updates only the initial ipynb file. You can also manually save the notebook by clicking on the menu and under “File” select “Save and checkpoint”.

Now that you know how to start using notebooks in Azure Machine Learning Studio I strongly recommend going and playing with them as it can really help you put your code together and collaborate easily with others.