Run Programming Exercises Locally

MLCC's programming exercises are available for download in Jupyter notebook (.ipynb) format. To run the exercises on your local machine:

  1. Download exercises
  2. Install and run Jupyter:
  3. Run the exercises

Download Exercises

Download the .zip of exercises here:

http://download.mlcc.google.com/mledu-exercises/mlcc-exercises_en.zip

and unpack the files to the location of your choice.

Next, install and run Jupyter using the appropriate instructions for your OS below.

Install and Run Jupyter on Windows

  1. From https://www.anaconda.com/download, install the Python 3.6 version of Anaconda. The exercises will not work on the Python 2.7 version.
  2. Once installed, open Anaconda Prompt from the Start menu and enter the following commands:

    conda create -n mlcc pip python=3.6
    conda activate mlcc
    pip install  --ignore-installed --upgrade \
      tensorflow matplotlib pandas sklearn scipy seaborn
    
  3. When all of the packages finish installing, open Anaconda Navigator from the Start menu. In the Navigator:

    1. Switch to the mlcc environment, as shown in the following screenshot. Every time you open Jupyter, you must select the mlcc environment. Screenshot of Anaconda Navigator, with 'mlcc' selected from
        environment dropdown
    2. Install notebook within the mlcc environment, as shown here: Screenshot of Anaconda Navigator, with an arrow pointing
        to the 'install' button for Jupyter

    3. Once notebook is installed, click Launch. This will open a web browser.

Next, run the exercises.

Install and Run Jupyter on Mac OS X

  1. If you have not installed XCode, install it by running this command (this takes a while):

    xcode-select --install
    
  2. Install pip and virtualenv:

    sudo easy_install pip virtualenv
    
  3. Set up your virtual environment in a new directory (here, we call it `mlcc-exercises):

    mkdir mlcc-exercises
    cd mlcc-exercises
    virtualenv --no-site-package jupyter-env
    
  4. Set up and run Jupyter.

    1. Enter the virtual environment:
      source jupyter-env/bin/activate
      
    2. Install libraries:
      pip install  --ignore-installed --upgrade \
        tensorflow "matplotlib<3" pandas sklearn scipy seaborn ipython==5.7 notebook
      
    3. Start Jupyter:
      jupyter notebook
      

Next, run the exercises.

Install and Run Jupyter on Linux

  1. Install Python and pip:

    sudo apt-get install python-dev python-pip
    
  2. Set up your virtual environment in a new directory (here, we call it mlcc-exercises):

    mkdir mlcc-exercises
    cd mlcc-exercises
    virtualenv --no-site-package jupyter-env
    
  3. Set up and run Jupyter.

    1. Enter the virtual environment:
      source jupyter-env/bin/activate
      
    2. Install libraries:
      pip install  --ignore-installed --upgrade \
        tensorflow "matplotlib<3" pandas sklearn scipy seaborn ipython==5.7 notebook
      
    3. Start Jupyter:
      jupyter notebook
      

Next, run the exercises.

Run Exercises

After installing and starting Jupyter, in the Jupyter web interface, navigate to where you unpacked the exercises:

Screenshot of Jupyter file-browser interface, with
          the 'mlcc-exercises' directory circled.

Click on the link for the exercise you want to open.