Welcome to the C29331 Machine Learning repository! This project is aimed to assist you in working on the exercises.
You will need to work with your terminal to get these tools installed.
Make sure you have Git installed on your machine. You can download it from the official website and follow the installation instructions for your operating system using the official guide.
This guided repo assumes that you are working with Visual Studio Code. If you haven't installed it yet, please download and install it from the official website. It will also work with other IDEs, but I can only provide support for VS Code.
We will be using UV to manage our Python environment. Please download and install it on your device using the official installation guide.
Clone the repository to your local machine using the following command:
git clone https://github.com/ItsZiroy/hwg-ml.gitNavigate into the cloned directory:
cd hwg-mlYou can use either UV (recommended for this course) or Anaconda/Conda. Pick the workflow you prefer — both will let you open and run the notebooks in exercises/.
Create a new Python environment and install the pinned dependencies from pyproject.toml and uv.lock with:
uv syncUV will create a local virtual environment (usually at .venv/ inside the project) and install all required packages. After uv sync you can:
- Let VS Code pick the
.venvinterpreter (see the next section), or - Activate manually in a terminal:
source .venv/bin/activate(macOS / Linux) and then run notebooks or commands.
If you prefer Anaconda/Miniconda, use a Conda environment instead. Example steps:
- Install Anaconda or Miniconda from the official site if you don't have it already.
- Create and activate a new environment:
conda create -n hwg-ml python=3.13 -y
conda activate hwg-ml- Install the project (and its dependencies) from the repository root. This will read
pyproject.tomland install the depdendencies:
pip install -e .Notes:
- Conda environments are usually listed by VS Code automatically. If the env doesn't appear, restart VS Code or run the following command to register the kernel manually:
python -m ipykernel install --user --name=hwg-ml --display-name "Python (hwg-ml)"This repository includes a command-line tool (hwg-ml) for downloading course materials from the course website.
After setting up your environment, install the CLI tool:
If using UV:
source .venv/bin/activate
uv pip install -e .If using Conda:
conda activate hwg-ml
pip install -e .The hwg-ml command will be available when your environment is activated.
You will find all exercises on the course page. You can either manually copy the unziped folder with the exercise into the exercises folder in the repository or you can use the CLI to download them automatically.
Download all exercises for the course:
hwg-ml exercises update
# or without an active environment
uv run hwg-ml exercises updateOptions:
--output/-o: Specify output directory (default:exercises/)
Download all lecture PDF slides:
hwg-ml lectures update
# or without an active environment
uv run hwg-ml lectures updateOptions:
--output/-o: Specify output directory (default:lectures/)
- Open Visual Studio Code.
- Install the Python extension for VS Code if you haven't already. You can find it in the Extensions view, search for "Python", and install the one published by Microsoft.
- Open the cloned repository folder in VS Code by selecting
File > Open Folderand navigating to thehwg-mldirectory. - Copy over the exercise files and open the (
.ipynb) in the repository.
- On the Top Right Corner of the VS Code window, click on the Python kernel selector.

- Click on "Python Environment"

- Select the interpreter that corresponds to the environment you created:
- If you used UV: choose the
.venv/bin/pythoninterpreter inside the project folder (the images show this flow).
- If you used Conda: pick the Conda environment (it may be shown as
conda: hwg-mlor by the full interpreter path)
If the environment doesn't show up in the list, restart VS Code or open a terminal from VS Code with the env activated and try again.
You can now run the cells in the Jupyter Notebook by clicking the "Run" button or using the keyboard shortcut Shift + Enter.
If you have GitHub Copilot enabled in VS Code, I recommend you turn it off. Ultimately it is you decision, but if you leave it on, you will not actually learn anything.
- Open the Command Palette by pressing
Ctrl + Shift + P(orCmd + Shift + Pon macOS). - Type "Copilot: Disable Completions" and select the option to disable GitHub Copilot
You may re-enable it later by following the same steps and selecting "Copilot: Enable Completions".

