Link Search Menu Expand Document

Jupyter Notebooks

We will be using Jupyter Notebooks in this class as a way to explore machine learning concepts, complete in-class activities, and work on projects.

Getting started

If you are familiar with Jupyter notebooks, you can use whatever environment you want to run them. If you are not familiar with them, there are a few ways to get started.

These steps will install Anaconda (a Python distribution) on your local computer.

  • Download Anaconda.
  • Open Anaconda Navigator. Find JupyterLab and click Launch. <# alt text #>

Run JupyterLab through the command line

If you feel comfortable at the command line and have a working Python installation, you can install Jupyterlab using one of these methods:

  • Via pip:
    • pip install jupyterlab
  • Via conda:
    • conda install -c conda-forge jupyterlab

Run JupyterLab with the command jupyter-lab.

Run notebooks in the cloud

There are a number of services that will run notebooks in the cloud. For these, you will need to upload the notebooks from class into the cloud interface.

Emergency

Using this link will let you view the notebooks, but it won’t save any of your work:

Open notebooks in binder

This one will load more quickly, but you will have to manually upload the notebooks:

Open JupyterLite

Getting the notebooks for class

I will distribute notebooks for class via Git. If you haven’t used or Git or Github before, that’s ok!

If you are using the lightning.ai notebooks in the cloud, launch the VSCode IDE, and go to the Source Control toolbar along the left side of the screen. Once there, look for the three horizontal dots, click then, and choose “Pull” from the menu that appears. This will sync your environment with mine.

If you are running the environment on your own laptop, here’s the easy way to get set up:

  • Download Github Desktop and install it: https://desktop.github.com/
  • Run the program and choose File -> Clone Repository.
    • Choose “URL,” then enter https://github.com/pkirlin/ml-s26-materials for the repository URL.
    • Under “Local Path,” click “Choose…” and find a place on your computer you want to store your notebooks for this class. I recommend creating a new folder for this.
    • Then Click “Clone.”

    <# alt text #>

  • This will download a number of notebooks into the folder you chose.

Updating the repository

  • There will frequently be new notebooks for you to download. The easiest way to update them is:
  • Open Github Desktop and choose “Fetch origin” from the toolbar area at the top: <# alt text #>
  • Once you do that, if there are updates you haven’t downloaded yet, the button will change to “Pull origin,” and you can click it again to download the new notebooks. <# alt text #>