Four steps to master machine learning with python (including free books & resources)

To understand and apply machine learning techniques you have to learn Python or R. Both are programming languages similar to C, Java or PHP. However, since Python and R are much younger and “farer away” from the CPU, they are easier. The advantage of Python is that it can be adopted to many other problems than R, which is only used for handling data, analysing it with e.g. machine learning and statistic algorythms and ploting it in nice graphs. Because Python has a broader distribution (hosting websites with Jango, natural language proecssing, accessing APIs of websites such as Twitter, Linkedin etc.) and resembles more classical programming languages like C Python is more popular.

The four steps of learning machine learning in python

  1. First you have to learn the basics of Python using books, courses and videos.
  2. Then you have to master the different moduls such as Pandas, Numpy, Matplotlib and Natural Language Processing (NLP) in order to handle, clean, plot and understand data.
  3. Afterwards you have to able to scrap data from the web which is either done by using APIs of websites or the web-scraping moduls Beautiful Soup. Web scraping allows you to collect data which you feed into you machine learning algorithms.
  4. In the last step you have to learn machine learning (ML) tools like Scikit-Learn or implement ML-algorithm from scratch.

1. Getting started with Python:

And easy and fast way to learn Python is to register at and imediately start to code and learn the basics of python. A classic is the website learnpythonthehardway which is referenced by a lot of python programmers. A good PDF is a byte of python. A list of python resources for beginners is also provided by the python community. A book from O’Reilley is Think Python, which can be downloaded for free from here. A last resource is Introduction to Python for Econometrics, Statistics and Data Analysis which also covers the basics of Python.

2. Important Modules for machine learning

The most important modules for machine learning are NumPy, Pandas, Matplotlib and IPython. A book covering a couple of these modules is Data Analysis with Open Source Tools.  The free book Introduction to Python for Econometrics, Statistics and Data Analysis from 1. also covers Numpy, Pandas, matplotlib and IPython. Another resource is Python for Data Analysis: Data Wrangling with Pandas, NumPy, and IPython, which also covers the most important modules. Her are other free Numpy (Numerical Python, Numpy Userguide, Guide to NumPy), Pandas (Pandas, Powerful Python Data Analysis Toolkit, Practical Business Python, Intros to Pandas Data Structure) and Matplotlib books.

Other resources:

3. Mining and scraping the data from websites and through APIs

Once you have understood the basics of python and the most important modules you have to learn how to collect data from different sources. This technique is also called web scrapping. Classic sources are text from websites, textual data through APIs to access websites such as twitter or linkedin. Good books on web scraping are Mining the Social Web (free book!)Web Scraping with Python and Web Scraping with Python: Collecting Data from the Modern Web

Lastly this textual data has to be transformed into numerical data, which is done with natural language processing techniques covered by Natural language processing with Python and Natural Language Annotation for Machine Learning. Other data are images and videos, which can be analysed using computer vision techniques: Programming Computer Vision with PythonProgramming Computer Vision with Python: Tools and algorithms for analyzing images  and Practical Python and OpenCV are typical resources to analyse images.

Educational and interesting examples of what you can already do using basic python commands and web scraping techniques can be found in these examples:

4. Machine learning with Python

Machine learning can be divided into four groups. Classification, clustering, regression and dimensionalty reduction.



Classification can also be called supervised learning and helps one to classify an image in order to identify a symbol or face in the image, or to classify a user from its profile and to grant him different credit scores. Clustering happens under unsupervised learning and allows the user to identify groups/clusters within its data. Regression permits to estimate a value from a paramter set and can be used to predict the best price for a house, apartment or car.

All important modules, packages and techniques to learn Machine Learning in Python, C, Scala, Java, Julia, MATLAB, Go, R and Ruby. Books about machine learning in python:

I especially recommend the book Machine learning in action. Although a bit short it is probably a classic in machine learning due to its age Programming Collective Intelligence. These two books let you build machine learning algorithms from scratch.

Most recent publications about machine learning are base on the Python module scikit-learn. It makes machine learning very easy since all the algorithm are already implemented. The only thing you do is to tell python which ML-technique should be used to analyse the data.

A free scikit-learn tutorial can be found on the official scikit-learn website. Other posts are be found here:

Books about machine learning and the module scikit-learn in Python are:

Books which are published in the coming months are:

Courses and blogs about Machine learning

You want to earn a degree, take an online course or attand a real workshop, camp or university course? Here are some links: Collection of links to online education in analytics, Big Data, Data Mining, and Data Science. Coursera course in machine learning and Data Analyst Nanodegree from Udacity are other recommended online courses. List of frequently updated blogs about machine learning.

A great youtube video is this class from Jake Vanderplas, Olivier Grisel about Exploring Machine Learning with Scikit-learn!

Theory of Machine Learning

Want to learn the theory of machine learning? The Elements of statistical Learning and Introduction to Statistical Learning are often cited classics. Other books are Introduction to machine learning and A Course in Machine Learning. The links contain free PDF, so you don’t have to pay them! Don’t want to read this? Watch 15 hours theory of machine learning!


Leave a Reply

Your email address will not be published. Required fields are marked *