Python code for Machine Learning class offered by Coursera

Standard

Sorry for the shilling, but here’s my upcoming project:

https://plusplusone.herokuapp.com

Please register your email address if you’re interested in it.


Edit: Sadly by the request of Coursera itself, I’ve removed this particular github repository. Coursera is doing the right thing though, don’t blame them.

 

I applied and followed Machine Learning course which is taught by Andrew Ng and offered freely online on Coursera (https://www.coursera.org/course/ml). However since the Octave installed on my computer doesn’t work properly (e.g. plotting functionality doesn’t work at all, etc), I decided to use python instead.

I managed to solve all of the programming exercises offered, in python instead of Octave. You can access the exercises’ solutions here: https://github.com/subokita/mlclass

In order to get started with python for machine learning, you might want to install these python libraries / modules:

  1. Numpy (http://www.numpy.org), for matrix and array manipulations
  2. Scipy (http://www.scipy.org), used mainly on optimization / minimization functions
  3. Matplotlib (http://matplotlib.org), for plotting
  4. NLTK (http://www.nltk.org), mainly for preprocessing text in spam detection section
  5. Sci-Kit Learn (http://scikit-learn.org/stable/), used for the SVM section. This is a great machine learning library

http://penandpants.com/2013/04/04/install-scientific-python-on-mac-os-x/ has a good write up on how to install most of these modules using Homebrew and pip.

Advertisements

7 thoughts on “Python code for Machine Learning class offered by Coursera

  1. nice! thanks for the share – i’m trying to move from matlab to python and was told to do the ml exercises in python instead. Now i can see how other people would go about the same problem and make improvements, many thanks

    • You’re welcome! I did it in Python because my Octave doesn’t have the full functionalities. Great to see that it’s useful for others.

  2. rajbir singh

    great work subokita.. beautiful ise of python.great help for those who want to learn python immensely useful to me… got better understanding than i would have got through matlab or tutorial videos …:)

    • Hmm, I googled for the programming language, and it sounds interesting. Although I dunno whether all the current libraries I used in python examples (e.g. scikit, nltk) can be bound to Julia.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s