The notebooks use a virtual environment based on miniconda3 that you need to install first. You can find detailed instructions for various operating systems here.
[conda] is the package manager provided by the Anaconda python distribution that is tailored to faciliate the installation of data science libraries.
Just like there are virtual environments for generic python installations, conda permits the creation of separate environments that are based on the same interpreter (miniconda3 if you followed the above instructions) but can contain different package and versions of packages. See also here for a more detailed tutorial.
You can create a new conda environment with name env_name
and one or more packages with a specific version number using the command:
conda create --name env_name package=version_number
e.g.
conda create --name pandas_environment pandas=0.24
Here, we will create an environment from a file to ensure you install the versions the code has been tested with. The environment specs are in the file environment_[linux|mac_osx].yml
in the root of this repo, where you should choose the one corresponding to your operating system. To create the environment with the name ml4t
(specified in the file), just run:
conda env create -f environment_linux.yml
or
conda env create -f environment_mac_osx.yml
from the command line in the root directory.
In case conda
throws a RemoveError
, a quick fix can be:
conda update conda
possibly adding --force
.
After you've create it, you can activate the environment using its name, which in our case is ml4t
:
conda activate ml4t
To deactivate, simply use
conda deactivate
jupyter notebooks can use a range of extentsion provided by the community. There are many useful ones that are described in the documentation.
The notebooks in this repo are formatted to use the Table of Contents (2) extension. For the best experience, activate it using the Configurator inthe Nbextensions tab available in your browser after starting the jupyter server. Modify the settings to check the option 'Leave h1 items out of ToC' if not set by default.