Hi there! This web page has been created to guide you through all the setups so you can start practising the exercises of our course (ML@LPI or ML@BINP). However, it provides quite a general recipe on how to install things, so feel free to come back to it in the future. If something doesn't really work or you experiencing some issues, we would be happy to help - contact us in the course chat or in another preferable way (links and contacts are on the git page of the course).

Introduction

In the following classes we will heavily use Jupyter as a framework for code development. The whole ecosystem is build around the concept of notebook - a format, which allows you to interactively develop and run the code in a fine-grained manner inside of one single file. There is no scripts anymore but rather cells, where you execute small pieces of code and immediately see the output. OK, it will take us a long time to introduce you to Jupyter, so we recommend you to check out their documentation page for a nice and detailed explanation and definitely this page which will guide you through the main concepts and also let you play around.

Recently the next step further has been made and JupyterLab appeared. It made the Jupyter workflow even more flexible by integrating into a single workspace the ability to work not only with Jupyter notebooks but also with text editors and terminals simultaneously. In addition, you can also navigate through the files on your computer and that's all inside one browser page! Indeed, JupyterLab has taken the concept of interactive programming to the next level, and we will use it in our classes as well.

On this page you will find instructions helping you to set up Jupyter and the surrounding environment ****on your laptop. We have to admit that for our course it is compulsory to have a laptop with Linux or MacOS installed, so please make sure that you feel yourself comfortable with either of these OS. We personally can't imagine doing science/data science on Windows - it is pain in the ass with lots of workarounds and tricks which make you suffer and prevent you from doing actual research and having fun. Therefore we believe that the earlier one starts working on Linux/MacOS, the faster will be their growth as a researcher. So if you have hard time installing them or some other issues/questions, then drop us a message🙂

Coming back to the instructions, we hope that they will provide a smooth transition to the actual coding and developing ML stuff. But again if you find yourself stuck with setting Anaconda/Jupyter and something doesn't work or if you simply have some questions - don't hesitate to contact us, we will help you to get the things going!

Installation

NB: if you already have Miniconda/Anaconda and don't want to install it once again, then you might want to skip step 1 and start from step 2.

1) downloading Miniconda

Firstly, let's download a Miniconda release (well, a mini version of Anaconda) and here we take v4.8.3, but in principle things should work for any other recent version. In your current directory execute (this will download and run the installer):

#Linux:
wget <https://repo.anaconda.com/miniconda/Miniconda3-py37_4.8.3-Linux-x86_64.sh>
bash Miniconda3-py37_4.8.3-Linux-x86_64.sh

In the prompt agree with Terms and Conditions and specify the location where Miniconda and all the future packages will be stored from now on. After installation is finished agree to initialise Miniconda (or disagree and then you will need to set it up yourself).

#MacOS:
wget <https://repo.anaconda.com/miniconda/Miniconda3-py37_4.8.3-MacOSX-x86_64.sh>
bash Miniconda3-py37_4.8.3-MacOSX-x86_64.sh

2) installing environment

By design Miniconda is shipped with very basic packages, so we need to install all we need on our own. We are going to do this using .yml file, where one can specify in details what they want to have. This is done by setting up a dedicated environment which will store all the Python packages and dependencies we need. And that's exactly what is described in .yml file: the name of the conda environment, the channels where the packages will be looked for and the dependencies themselves along with their versions.

The setup of the environment which we are going to use is described in .yml file which you can find in the git repo of the corresponding course. Firstly, inspect which packages will be installed. Of course, you can add your own there or change the name of the environment.

Moving on, let's create the environment! In terminal execute:

# this might take a while...
conda env create -f {corresponding .yml file with env}

What will happen now is that conda will be downloading and installing the packages which we specified in .yml file together with their dependencies to the directory which you entered during the Miniconda installation.

Once it is done, let's activate and get into our conda environment (note: to deactivate and get out of the environment do conda deactivate):