Homework 01

Goals for the day

  • Set up python dev environment on school or personal laptop
  • Raspberry Pi Project
  • Money List

Set up dev environment

You need a decent amount of software to do real machine learning and your life will be much easier if we all have the same dev environment, to a certain degree. Here are steps we can take to try to get on the same page (these instructions are not perfect and if you get stuck, try to figure it out or we’ll fix it in class)

  1. Install a real text editor (VSCode, Atom, Sublime, vim, emacs, …). If you don’t know or care, do VSCode.
  2. On a Windows machine, install WSL (Windows Subsystem for Linux) following these instructions. Be sure to select Ubuntu 22 for your distribution (unless you are sure you will never need to ask me for help).
  3. Inside linux (WSL or Mac/Linux bash shell), install asdf (a version manager for executables) according to these instructions.
  4. Set up python
    1. Restart your shell (in WSL or Mac/Linux bash shell)
    2. asdf plugin add python
    3. asdf install python 3.11.9
    4. asdf global python 3.11.9 or asdf local python 3.11.9
    5. Make a directory for your ML projects mkdir ~/ml then open the directory cd ~/ml and set up a virtual environment (next)
  5. Set up a virtual environment (a directory with specific version of python and libraries to use in your projects.)
    1. In your ml directory (cd ~/ml)
    2. Ensure you’re running python 3.11.9: python --version (if not redo step 4.4 above)
    3. Create a virtual environment python -m venv env (This creates a directory named env with a local install of python)
    4. Activate the environment source env/bin/activate
    5. Copy this file to your folder ~/ml as requirements.txt.
    6. Install the libraries pip install -r requirements.txt
    7. Everything should install with no errors (warnings are OK.)
    8. See if jupyter is working: jupyter-lab (should open a browser)

Action Item: (As much as possible…) Set up a functioning python 3.11.9 dev environment with Jupyter and a text editor. Use the provided requirements.txt file to create a virtual environment with the packages needed for class.

Optional (last resort)

If the WSL route is too complicated for now or just not working, Anaconda will get you up and running. The reason this is not recommended is that Anaconda installs a LOT of software and does a LOT of setup behind the scenes. And when you want to change something, or bypass Anaconda for a reason, it can be tricky to disable it. That said, it is very popular and good at what it does.

Install Anaconda for Windows

Raspberry Pi Project

I have about 25 Raspberry Pi 3s and would like you to do something with one. Go home, read about them, find a fun project or something to install or make and come tell me what it is. If I approve, then I’ll give you a pi for a few days to make it work. In addition to the Pi we have sensors and peripherals and things so if you want to do something fancy we might be able to find the stuff for it. Just note: this is not a big project. Just a quick thing to get something up and running.

You will need a monitor, HDMI cable, keyboard and wired mouse to complete the initial Pi setup. After that it can run “headless” on your home network. If you don’t have these things at home, we can probably get you to do the initial setup here at school.

Action Item: come to class with some ideas for projects. Be ready to discuss with friends and/or the teacher.

The Money List

Your money list is a list of ideas that will make you money! You’ll add to it all year. It starts off simple: write down things that annoy you and think of ways to fix them. The annoying things can be literally anything (that’s the point of brainstorming) and the “ways to fix them” can be outlandish. But, the goal is to occasionally stumble on an idea that is generally useful to lots of people and whose solution is something you can work on. If your idea is good enough and your solution works, then sell it. Make money!

Action Item: Start the list somewhere semi-permanent. In a notebook, on your computer, Google Drive, or your phone. (the best might be a cloud file shared to multiple devices). Try to find 3 ideas by next class. Don’t be too picky