Getting Started with Machine Learning

See what people build with machine learning and the projects you'll build in this course, then set up your own Windows or Mac computer: Python, VS Code, a virtual environment with pandas and scikit-learn, and a notebook to try things in. You'll open your first dataset, a bakery's daily bread sales, and use Git to get exercise code and hand in your work.

Updated

What Machine Learning Can Do

  1. What You Can Build with Machine Learning (Novice): Machine learning is a computer working out a rule from past examples, the way a spam filter, a delivery estimate or a fraud check does, and this lesson shows where it's used, what it isn't (no magic, no promises, and in this course no chatbots), and the projects you'll build.
  2. How This Course Works (Novice): How Machine Learning with Python works on ask-codey.com, from reading a lesson and trying its Do It to exercises with their own data, a notebook to explore and a module pytest checks, chapter checks, module assessments, the projects you build, and why every number in a lesson can be reproduced.

Setting Up for Machine Learning

  1. Setup on Windows: Python, VS Code and Git (Novice): Install Python with the Python Install Manager, VS Code with its Python extension, and Git on Windows with winget, check them with py --version and python --version in VS Code's terminal, tell Git your name and email, and make a python-course folder.
  2. Setup on a Mac: Python, VS Code and Git (Novice): Install Homebrew, then Python, VS Code with its Python extension, Git and Git Credential Manager on a Mac, check Python with python3 --version in VS Code's terminal, see why the command is python3 on a Mac, tell Git your name and email, and make a python-course folder.
  3. Virtual Environments and pip (Apprentice): A virtual environment gives each Python project its own private set of packages, pip installs packages into it from PyPI, and a requirements.txt with exact versions lets any computer install the same set with one command.
  4. Installing the Machine Learning Toolkit (Apprentice): Machine learning in Python needs five packages that don't come with Python, NumPy, pandas, scikit-learn, matplotlib and ipykernel, installed into a project's virtual environment from a requirements.txt that pins each exact version, checked with sklearn.show_versions(), and used from a notebook to explore and a .py file for the code pytest checks.

Notebooks

  1. Your First Notebook in VS Code (Novice): Make a notebook in VS Code, choose the project's .venv Python as its kernel, run code cells with Shift+Enter, see that a cell shows its last line's value while print() shows every line it prints, add a Markdown cell, and save the code, results and notes in one .ipynb file.
  2. The Kernel: Why Run Order Matters (Apprentice): A notebook's kernel remembers every name its cells made, in the order they ran rather than the order on the page, so a cell run twice or a deleted cell's variable gives answers the file can't reproduce; execution counts show the real order, Restart and Run All gives the file's true answers, the Variables view lists what the kernel remembers, and Interrupt stops a cell that runs too long.

Share Your Work with Git

  1. Get the Exercise Code with Git (Novice): Copy an exercise's repository from GitHub into your course folder with git clone, open the folder it makes in VS Code, and see with git status and git remote -v that your copy remembers where it came from.
  2. Hand In Your Work with Git (Novice): Hand in an exercise by making a public repository of your own on GitHub, pointing your clone at it with git remote set-url, saving your work with git add and git commit, sending it with git push, and submitting the repository's address.

Exercise: Bakery Data Check

  1. Exercise: Bakery Data Check (Apprentice): Clone the course's first exercise, make its virtual environment, install the pinned toolkit, read how Sunrise Bakery's data was made, and finish three functions that report the installed versions, load the bakery's 120 days and count the table's rows and columns, then let pytest check them and hand the work in with Git.