To get the most out of the DAT158 machine learning course, you might want to set up the course material on your personal computer. Follow the steps below to install Python and the necessary Python libraries.
Note that you can also work with the course material in the cloud using Google Colab or Kaggle Code or similar services.
If you are a MacOS user:
- You might need Xcode, which is a free development tool. Download it here.
- To install, open
terminal.app
:- Press
CMD+SPACE
and search for Terminal. - In the terminal, run
xcode-select --install
.
- Press
The recommended way to install Python for this course is via the Anaconda Distribution. It comes with the Conda Package Management System.
From the documentation: "Conda is an open source package management system and environment management system that runs on Windows, macOS and Linux. Conda quickly installs, runs and updates packages and their dependencies. Conda easily creates, saves, loads and switches between environments on your local computer."
After you've installed Anaconda:
- Open a terminal (or "Anaconda Prompt" for Windows users).
- Run
python --version
. - Ensure the output mentions "Anaconda". If so, proceed to the next step.
Now you're ready to get the course environment up and running
After you have Anaconda set up, follow these steps (Windows users, stick with the "Anaconda Prompt"):
- Open a terminal (or "Anaconda Prompt" for Windows users).
- Run
conda install git
- Run
git clone https://github.com/HVL-ML/DAT158
. - Change to the course directory by running
cd DAT158
.
- Make sure that you're in the course directory. If not, run
cd DAT158
. - Run
conda env update
.
- Run
conda activate dat158
.
- Make sure the
dat158
environment is activated. If not, runconda activate dat158
. - Run
python -m ipykernel install --user --name dat158 --display-name "DAT158"
- Make sure that you're in the course directory. If not, run
cd DAT158
. - Run
jupyter notebook
to open the test notebook located atnotebooks/0.0-test.ipynb
. - Alternatively, run
jupyter lab
to open the test notebook in JupyterLab. Open the test notebook located atnotebooks/0.0-test.ipynb
using:
- GNU/Linux or MacOS activation issue: If
conda activate dat158
fails, try executingsource ~/.bash_profile
and repeat the activation. - Mac
gcc
error during environment update: Install Xcode from the App Store and then install the command line tools.
The course materials will evolve over time. Ensure you're always up-to-date by regularly executing the following commands:
- Update the course materials:
git pull
- Update the Python environment:
conda activate dat158
conda env update