/ml_exercises

Python Exercises for my Machine Learning Course

Primary LanguageJupyter Notebook

Machine Learning Exercises

This repository contains the Python programming exercises accompanying the theory from my machine learning book. They are part of the curriculum of the ML for Data Scientists and ML in Practice Workshops.

If you have any questions, please send me an email.

Have fun!

Using Python

The programming exercises are written in Python. If you're unfamiliar with Python, you should work through this tutorial first.

Working on your own computer

The Python tutorial includes some notes on how to install Python and Jupyter Notebook on your own computer.
Please make sure you're using Python 3 and all libraries listed in the requirements.txt file are installed and up to date. You can verify this with the test_installation.ipynb notebook.
The dependencies listed in requirements.txt are sufficient to execute most notebooks. To run notebook 6 you additionally need to install torch, torchvision, and skorch (or tensorflow, depending on the version of the notebook you want to execute).

Working in the cloud

If you are unable to install Python on your own computer, you can also run the notebooks in a cloud environment.

Using MyBinder

The easiest way to run the notebooks is using MyBinder: Open in Binder
However, please note that MyBinder may take a while to load and some notebooks might be slow or even crash due to insufficient RAM. Furthermore, by default this environment does not include the necessary libraries to run notebook 6, since installing the neural network dependencies takes very long.

Using Google Colab

If you have a Google account, you can also run the notebooks in Google Colab, which is faster than MyBinder: Open In Colab
While Google Colab already includes most packages that we need, should you require an additional library (e.g., fastapi[all] for the case study in notebook 5b), you can install a package by executing !pip install package in a notebook cell. With Colab, it is also possible to run code on a GPU, but this has to be manually selected. Please note that for some notebooks you need to additionally upload the required data files separately.