Skip to content

Commit

Permalink
First version of documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
troelspetersen committed Apr 12, 2021
1 parent 534243d commit ebf9b00
Show file tree
Hide file tree
Showing 9 changed files with 470 additions and 2 deletions.
51 changes: 49 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,49 @@
# AppliedML2021
GitHub repository for the course "Applied Machine Learning" 2021 at University of Copenhagen
# AppliedML2021 - Code Repository

GitHub repository for code used in the course "Applied Machine Learning" 2021 at University of Copenhagen.

## Getting Started

The following instructions will help you install the relevant software that will be used in the course.

You have two options for installing and running the Applied ML notebooks. The primary option is to install everything on your laptop, using e.g. the anaconda environment with a standard set of python libraries. The second option is to run the code on [ERDA](https://erda.ku.dk), a KU-based server platform that has the advantage of having a uniform software environment for everyone. If you are not enrolled as a KU student and want to use this option, you should contact [Troels](mailto:[email protected]) to get access to the ERDA servers.

We recommend that you use your laptop, but perhaps also that you try both methods for the course. Having a local copy of the exercices can be very handy when the ERDA servers are down (for maintenance or other reasons), and when you finish your studies and start one something new. But ERDA gives you a feel for how remote computing works, and allows you to suddenly go from 1 CPU to many. Trying both is simply our attempt at boosting your knowledge of computing. But if you never try ERDA, don't worry.


---
### Option A. Running things on your laptop

To run things on your local computer, you will have to install additional software to be able to properly run the notebooks.

Given the wide range of operating systems available out there, we cannot guarantee that the instructions above will work on _all_ platforms. As of now, __the instructions below have been tested on the following systems:__

* [__Instructions for Linux__](./docs/install_instruction_linux.md)

* [__Instructions for Windows 10__](./docs/install_instruction_windows10.md)

* [__Instructions for MacOs Mojave__](./docs/install_instruction_macos_mojave.md)


---
### Option B. Running things on ERDA

* [__The instructions for using ERDA are available here__](./docs/install_instruction_erda.md)


---
### Option C. Manually downloading the course content

If you do not want to subscribe to github, you can still download manually the content of the repository using the __donwload zip__ option on the main page of this git. [More details are available here](./docs/manual_copy_of_code.md)


---
## Running things after installation

Once you have installed the required software and cloned the repository, you can run your notebooks, and update the content of the repository by following [__these instructions__](./docs/running_after_install.md)


---
## Link to Course Information

* [Course Main page](https://www.nbi.dk/~petersen/Teaching/AppliedMachineLearning2021.html)
12 changes: 12 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

[return to the main page](../README.md)

# AppStat2020 - Instructions for installing the repository locally
---


* [__Instructions for Linux__](install_instruction_linux.md)

* [__Instructions for Windows 10__](install_instruction_windows10.md)

* [__Instructions for MacOs Mojave__](install_instruction_macos_mojave.md)
1 change: 1 addition & 0 deletions docs/how_to_use_this_git.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Working with the code repository
59 changes: 59 additions & 0 deletions docs/install_instruction_erda.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[Back to main installation page](README.md)

## Installation instruction - ERDA

Since the software environment on ERDA already includes all the software tools necessary to run the notebooks, the only thing that has to be done there is to clone the code repository in your local workspace.


### Logging on to ERDA and cloning the code repository
---

#### Get Registered on ERDA (email [Troels](mailto:[email protected]) to get registered)

#### [Get a github account](https://github.com/).

If you do not wish to do so, you can still access the course content by manually downloading the repository (see __Option C__ below)

#### Clone the Applied Statistics Repository


<details><summary>From your ERDA homepage, click on the <b>jupyter</b> option in the side menu</summary>
<img src="/images/ERDA_step1.png"
title="ERDA main menu"/>
</details>


<details><summary>Start a terminal session by clicking the <b>Start DAG</b> button</summary>
<img src="/images/ERDA_step2.png"
title="ERDA main menu"/>
</details>



<details><summary>To spawn the correct environment for the course, select the option <b>Statistics Notebook with Python</b> </summary>
<img src="/images/ERDA_step3.png"
title="ERDA main menu"/>
</details>



<details><summary>Open the <b>Terminal</b> option </summary>
<img src="/images/ERDA_step4.png"
title="ERDA main menu"/>
</details>


You should now have a terminal window opened in your screen. If you type in the command `ll`, you should see a list of folder in your space. Move into the __work__ folder by typing the command `cd work`.

<details><summary>Click here to see the image</summary>
<img src="/images/ERDA_step5.png"
title="ERDA main menu"/>
</details>


Once you are in your __work__ folder, make yourself a local copy of the code repository by typing the command `git clone https://github.com/AppliedStatisticsNBI/AppStat2020.git ./AppStat2020_local/`. If you list the content of your __work__ directory, you should now see a local copy of the code appear on your machine.

<details><summary>Click here to see the image</summary>
<img src="/images/ERDA_step6.png"
title="ERDA main menu"/>
</details>
77 changes: 77 additions & 0 deletions docs/install_instruction_linux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[Back to main page](../README.md)


## Installation instruction - Linux system

These steps have been tested on a Linux Mint 18, a variant of the Ubuntu flavour of linux systems.



### Installing the Anaconda environment

In order to run the exercices from the course, you will need to setup and install __anaconda for python 3__.


<details><summary>On the [anaconda website](https://www.anaconda.com/distribution/), download the python 3.7 version of anaconda. ake sure you are downloading the version that matches your <b>processor type </b> (you should download the x86 installer)</summary>
<img src="../images/anaconda_install1.png"/>
</details>

In the folder where you downloaded the installation script, run the latter using `bash Anaconda3-2019.10-Linux-x86_64.sh`. Type `enter` to start the process
<details><summary>Click here for image </summary>
<img src="../images/anaconda_install2.png"/>
</details>



Scroll through the licence agreement by pressing the return key. At the end, type `yes` to accept the license terms and conditions.
<details><summary>Click here for image </summary>
<img src="../images/anaconda_install3.png"/>
</details>


Anaconda provides you with a default path where it will install the relevant software. It is recommended that you change this directory name, like the example shown here. Once you have entered a new path name, type the return key and the installation will proceed.
<details><summary>Click here for image </summary>
<img src="../images/anaconda_install4.png"/>
</details>



Once the installation is finished, you will be asked if you ant to initialize the environment. __Type `no` to this step__.
<details><summary>Click here for image </summary>
<img src="../images/anaconda_install5.png"/>
</details>


Move to your home folder by typing `cd`. Open a file named `.bashrc`, and add the following line at the bottom of the file:
`alias anaconda3="export PATH=/home/username/some_path_name/bin:$PATH;source /home/username/some_path_name/bin/activate"`


Close your terminal and open a new one. When you type in `anaconda3`, your new anaconda environment should load. You are then ready to work on your notebooks.


### installing the iminuit minimizer tool

Open a new terminal, and load the anaconda environment by typing `anaconda3`. To install iminuit, type in the command: `conda install -c anaconda iminuit`. A prompt such as the one shown below will ask you to install the package, along with its dependencies (ie. additional software that iminuit needs to run properly)

<details><summary>Click here for image </summary>
<img src="../images/conda_install_iminuit.png"/>
</details>


Type in `y` and wait for the installation to complete. You should now be able to run the course notebooks.


### Clone the course repository

* Open a __terminal window__.

* If you don't have git installed on your laptop, install it by following [these instructions](https://gist.github.com/derhuerst/1b15ff4652a867391f03#file-linux-md)

* Clone the Applied statistics repository using the command
`git clone https://github.com/AppliedStatisticsNBI/AppStat2020.git ./AppStat2020_local/`.
Feel free to choose another name for your folder

* You now have a local copy of the repository


__Make sure you run the command__ `anaconda3` before running a notebook.
61 changes: 61 additions & 0 deletions docs/install_instruction_macos_mojave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

[Back to main page](../README.md)



## Installation instruction - MacOs

These instructions have been tested on a macbook pro from 2015 running the Mojave OS.


### Download Anaconda3

* Go to the [anaconda website] and download the __Command line installer__ for Mac.


<details><summary>Click to see snapshot</summary>
<img src="../images/anaconda_install_mac_1.png"/>
</details>


* In the __Launchpad__, find and click on the __Terminal__ icon.


* Once in the terminal, run the __anaconda installer__, by typing

`bash $HOME/Downloads/Anaconda3-2019.10-MacOSX-x86_64.sh`


* Scroll through the terms of the license and type `yes` to accept. You will be asked to define a path where anaconda can be installed. Feel free to use the pathname you want (we would suggest `/Users/your_username/AppliedStatistics/anaconda3/`)


* Anaconda will now install itself. At the end of the process, you will be asked if you want to initialize anaconda. __Type "No"__


* Move back to your home directory by typing `cd $HOME`. Open a file called `.bash_profile`, and type in at the bottom of the file the following line:

`alias anaconda3=". /path/where/you/saved/anaconda3/etc/profile.d/conda.sh; conda activate base"`


* Close your terminal and reopen a new one. To run anaconda, type in the command:

`anaconda3`


### Install iminuit

* Open a new terminal. Load the anaconda environment by typing in `anaconda3`. Then type in the command:

`conda install iminuit`

* Type `y` once the installer finds the dependencies that will be installed. You should now be able to run the applied statistics course exercices.


### Clone the Applied Statistics Repository

* In a folder of your choice, run the command for cloning the repository:

`git clone https://github.com/AppliedStatisticsNBI/AppStat2020.git .`


To run a notebook, make sure you activate your anaconda environment by typing `anaconda3`. You are now set to work on the notebooks!
122 changes: 122 additions & 0 deletions docs/install_instruction_windows10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@

[Back to main page](../README.md)


## Installation instruction - Windows

### __NOTE: WINDOWS INSTRUCTIONS ARE UNLIKELY TO WORK ON OLDER VERSIONS OF WINDOWS. IF YOU DON'T HAVE WINDOWS 10, WE RECOMMEND YOU DO YOUR WORK ON ERDA INSTEAD OF YOUR OLD LAPTOP__



### Installing Anaconda on Windows 10
---
These steps have been tested on an up-to-date version of Windows 10 (admittedly, only tested/updated Nov. 4 2019).

On the [anaconda website](https://www.anaconda.com/distribution/), download the python 3.7 version of the anaconda installer for windows. __Make sure to select the right file for your system (32-bit or 64-bit)__

<details><summary>Click here for a picture</summary>
<img src="../images/anaconda_windows_1.png"/>
</details>

Launch the installer program, and click __next__.
<details><summary>Click here for a picture</summary>
<img src="../images/anaconda_windows_2.png"/>
</details>

Click on __I agree__ at the bottom of the licence.
<details><summary>Click here for a picture</summary>
<img src="../images/anaconda_windows_3.png"/>
</details>


Select the __Just me__ option.
<details><summary>Click here for a picture</summary>
<img src="../images/anaconda_windows_4.png"/>
</details>


Select the folder where you want to install anaconda and click on __Next__.
<details><summary>Click here for a picture</summary>
<img src="../images/anaconda_windows_5.png"/>
</details>


Make sure that both options are unchecked and click __install__.
<details><summary>Click here for a picture</summary>
<img src="../images/anaconda_windows_6.png"/>
</details>


Once the installation finishes, click on __Next__.
<details><summary>Click here for a picture</summary>
<img src="../images/anaconda_windows_7.png"/>
</details>


Click on __Finish__ to complete the installation
<details><summary>Click here for a picture</summary>
<img src="../images/anaconda_windows_8.png"/>
</details>

### Installing iminuit

Iminuit should already be installed on the windows version of anaconda.


### Cloning the git repository
---
Download [git for windows](https://git-scm.com/download/win) and download the installer for your system (32-bit or 64-bit)
<details><summary>Click here for a picture</summary>
<img src="../images/git_windows_1.png"/>
</details>

Run the installer. Click on Next
<details><summary>Click here for a picture</summary>
<img src="../images/git_windows_2.png"/>
</details>

Select a location where to install git (it is recommended to use the default path)
<details><summary>Click here for a picture</summary>
<img src="../images/git_windows_3.png"/>
</details>

In the select Components window, leave the options checked to default. Make sure that __Git Bash__ is checked
<details><summary>Click here for a picture</summary>
<img src="../images/git_windows_4.png"/>
</details>

Keep clicking on __Next__ through the various options, leaving them at their default values.
<details><summary>Click here for a picture</summary>
<img src="../images/git_windows_5.png"/>
<img src="../images/git_windows_6.png"/>
<img src="../images/git_windows_8.png"/>
<img src="../images/git_windows_9.png"/>
<img src="../images/git_windows_10.png"/>
<img src="../images/git_windows_11.png"/>
<img src="../images/git_windows_12.png"/>
</details>


Keep clicking on __Install__. Leave the option on that window unchecked.
<details><summary>Click here for a picture</summary>
<img src="../images/git_windows_13.png"/>
</details>


Keep clicking on __Finish__ after the process is completed.
<details><summary>Click here for a picture</summary>
<img src="../images/git_windows_14.png"/>
</details>

Once this is done, open the __Windows Explorer__ window, create a new folder where you want to save the repository, and right click inside that folder. There should now be an option in the menu called __Git Bash Here__

<details><summary>Click here for a picture</summary>
<img src="../images/git_windows_15.png"/>
</details>

The previous steps opens a terminal window at the location you created. In that terminal window, type in the command:
`git clone https://github.com/AppliedStatisticsNBI/AppStat2020.git .`

<details><summary>Click here for a picture</summary>
<img src="../images/git_windows_gitterminal.png"/>
</details>
Loading

0 comments on commit ebf9b00

Please sign in to comment.