Skip to content

Thogan24/ml-python-assignments

 
 

Repository files navigation

Downloading the Assignments

To get started, you can start by either downloading a zip file of these assignments by clicking on the Clone or download button. If you have git installed on your system, you can clone this repository using :

git clone https://github.com/dibgerge/ml-coursera-python-assignments.git

Each assignment is contained in a separate folder. For example, assignment 1 is contained within the folder Exercise1. Each folder contains two files:

  • The assignment jupyter notebook, which has a .ipynb extension. All the code which you need to write will be written within this notebook.
  • A python module utils.py which contains some helper functions needed for the assignment. Functions within the utils module are called from the python notebook. You do not need to modify or add any code to this file.

Requirements

These assignments has been tested and developed using the following libraries:

- python==3.6.4
- numpy==1.13.3
- scipy==1.0.0
- matplotlib==2.1.2
- jupyter==1.0.0
- jupyter-client==5.0.1

We recommend using at least these versions of the required libraries or later. Python 2 is not supported.

Once you have installed python, create a new python environment will all the requirements using the following command:

conda env create -f environment.yml

After the new environment is setup, activate it using (windows)

activate machine_learning

or if you are on a linux machine

source activate machine_learning 

Now we have our python environment all set up, we can start working on the assignments. To do so, navigate to the directory where the assignments were installed, and launch the jupyter notebook from the terminal using the command

jupyter notebook

This should automatically open a tab in the default browser. To start with assignment 1, open the notebook ./Exercise1/exercise1.ipynb.

Python Tutorials

If you are new to python and to jupyter notebooks, no worries! There is a plethora of tutorials and documentation to get you started. Here are a few links which might be of help:

Caveats and tips

  • In many of the exercises, the regularization parameter $\lambda$ is denoted as the variable name lambda_, notice the underscore at the end of the name. This is because lambda is a reserved python keyword, and should never be used as a variable name.

  • In numpy, the function dot is used to perform matrix multiplication. The operation '*' only does element-by-element multiplication (unlike MATLAB). If you are using python version 3.5+, the operator '@' is the new matrix multiplication, and it is equivalent to the dot function.

Acknowledgements

  • The questions are taken or largely inspired by Andrew Ng's Coursera course on machine learning.

About

Python assignments for the machine learning class

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 84.5%
  • Python 15.5%