Jupyter Notebooks, Linux, Machine Learning, Python, Windows

Machine Learning on Windows 10 – Part 4: Jupyter and Python

In the previous posts we setup WSL 2 and deployed the Ubuntu Linux OS. We also installed the Anaconda environment and learned how to start the Jupyter Notebook server.

In this post I will start a small project in Jupyter and run through some sample Python code.

I want all my notebooks to reside in a single folder under Documents\Jupyter. Start Windows Terminal, or whichever command shell you like, and open an Ubuntu command line. On the command line type the following, replaceing {username} as necessary

cd /mnt/c/Users/{username}/Documents

Create a new folder for the Jupyter Notebook projects and navigate to it.

mkdir Jupyter
cd Jupyter

Once in the folder, start the Jupyter Notebook server. If everythhing was setup correctly in the last post, this should start the service, and open a web brower. The browser will have the Jupyter Notebooks file explorer open in the directory we created above.

jupyter notebook

To create a new notebook, select the down arrow anext to the New button and select Python 3.

This will create a new “Untitled” notebook in the Documents\Jupyter folder, and take you to an edit page.

If you open Windows explorer, and navigate to the Documents\Jupyter folder you will find a new file named Untitled.ipynb.

Click on the name of the notebook, “Untitled” at the top of the page,

This will bring up an edit window alloing you to change the name of the workbook. I renamed it “Test Notebook”. Goint back to file eplorer, the filename has now changed to “Test Notebook.ipynb”

At this point we are ready to explore and learn the Jupyter interface. Instead of rewriting a step by step tutorial here, I will place a link to one I found online that seems pretty comprehensive. Navigate to the link below and step through. It will take some time.

https://problemsolvingwithpython.com/02-Jupyter-Notebooks/02.05-The-Jupyter-Notebook-Interface/

After walking thorugh the above tutorial, you should be familiar with the following concepts:

  • Code Cells
  • Output Cells
  • Markdown Cells
  • Changing the cell type
  • Saving\Renaming a Jupyter Notebook
  • Downloading a Jupyter Notebook
  • Saving Jupyter Notebooks in Other Formats

Now move on to the next tutorial about Magic commands. It has some useful pointers.

https://problemsolvingwithpython.com/02-Jupyter-Notebooks/02.06-Magic-Commands/

Once complete, review the summary and make sure you are familiar with each concept.

https://problemsolvingwithpython.com/02-Jupyter-Notebooks/02.08-Summary/

Here is a cheat list of terms and definitions:

https://medium.com/machine-learning-in-practice/cheat-sheet-of-machine-learning-and-python-and-math-cheat-sheets-a4afe4e791b6