## Supervised Learning: K Nearest Neighbours

Introduction to K Nearest Neighbours (KNN) KNN is a classification algorithm that in order to determine the classification of a point, combines the classification of the K nearest points. It is supervised because you are trying to classify a point based on the known classification of other points. For example, …

## Supervised Learning: Logistic Regression

Introduction to Logistic Regression We will be learning about logistic regression as a method of Classification. Some examples of classification problems include disease diagnosis, spam vs non-spam emails, loan default (yes/no), and etc… The examples listed are all known as Binary Classification. We can’t use a normal linear regression model …

## Supervised Learning: Linear Regression & Bias Variance Trade-off

Introduction to Linear Regression Model Case Study Your neighbor is a real estate agent and wants some help predicting housing prices for regions in the USA. It would be great if you could somehow create a model for her that allows her to put in a few features of a …

## Introduction to Machine Learning

Introduction In the Machine Learning part of the course, I will using the Introduction to Statistical Learning by Gareth James as a companion book. The book uses mainly R to teach machine learning but we will mainly be using this book for the mathematical theory! Machine Learning is a method …

## Python for Data Visualisation – Pandas (and Plotly & Cufflinks)

Introduction to Plotly and Cufflinks Plotly is an interactive visualisation library whereas cufflinks connects plotly with pandas. Plotly allows you to create interactive plots that you can use in dashboards or websites (you can save them as html files or static images). You can also use plotly to plot interactive …

## Seaborn – Exercises and Solutions

Data In [2]: import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline In [40]: sns.set_style(‘whitegrid’) In [15]: titanic = sns.load_dataset(‘titanic’) In [5]: titanic.head() Out[5]: survived pclass sex age sibsp parch fare embarked class who adult_male deck embark_town alive alone 0 0 3 male 22.0 1 0 7.2500 S Third man True NaN Southampton …

## Python for Data Visualisation – Seaborn (Part 2)

3. Matrix Plots In [1]: import seaborn as sns %matplotlib inline In [2]: tips = sns.load_dataset(‘tips’) flights = sns.load_dataset(‘flights’) In [3]: tips.head() Out[3]: total_bill tip sex smoker day time size 0 16.99 1.01 Female No Sun Dinner 2 1 10.34 1.66 Male No Sun Dinner 3 2 21.01 3.50 Male No Sun Dinner …

## Python for Data Visualisation – Seaborn (Part 1)

Introduction to Seaborn Seaborn is a statistical plotting library that’s built on top of Matplotlib. It has beautiful default styles and it work very well with pandas dataframe objects. The documentation for Seaborn can be found here: http://seaborn.pydata.org/. 1. Distribution Plots In [2]: import seaborn as sns In [3]: %matplotlib inline In [4]: tips …

## Matplotlib – Exercises and Solutions

Data In [9]: import numpy as np x = np.arange(0,100) y = x*2 z = x**2 Import matplotlib.pyplot as plt and set %matplotlib inline if you are using the jupyter notebook. What command do you use if you aren’t using the jupyter notebook? In [1]: import matplotlib.pyplot as plt In [2]: %matplotlib inline …

## Python for Data Visualisation – Matplotlib

Introduction to Matplotlib Matplotlib is the most popular plotting library for Python. It is a great 2D and 3D graphics library for generating scientific figures in a variety of hardcopy formats and interactive environments. Matplotlib allows you to create reproducible figures programmatically. The official Matplotlib web page can be found here: …