MLClass #1 : Types of Machine Learning Algorithms

Welcome to another article in the ML Class series! Here we will learn the basics of different types of machine learning algorithms used in the industry. We will be stating most of them in the future.

Before moving forward let’s know some basic terminology :

  • Target: predicted category or value of the data.
  • Features: properties of the data used for prediction.
  • Examples: a single data point within the data.
  • Label: the target value for a single data point
Screenshot from 2018-05-09 21-11-58
Famous Titanic Dataset from kaggle.com

Here, variable “Survived” is the Target variable whereas [“PassengerId”, “Pclass”, “Name”, “Sex”, “Age”, … etc] are Features. All the details of the person on Index 1 row (excluding “Survived”) is a single Example to the dataset whereas that person survived is the label.

  • Training set: dataset we use to train/teach our model
  • Test set: dataset on which we test our model for precision/accuracy

Now as you have got some insight of basic terminology now we can dive deeper to the main classification. Machine Learning algorithms are broadly divided into three types:

  • Supervised Learning
  • Unsupervised Learning
  • Reinforcement learning

What is supervised learning?

The problem statements where we have input variables (X) and an output variable (Y)  and we can predict Y as a function of X, i.e., Y = f(X) is known as Supervised machine learning. Also in supervised learning problems, the algorithms which we use are supervised by the training set which means that the algorithm makes predictions on the training set and as we know the answers the prediction making process is improved and the learning stops when an acceptable level of performance is achieved.

Supervised learning problems can be further grouped into:

  • Regression problem:

We can say a supervised learning problem is regression problem when output is a continuous function of the input.

Example: House pricing prediction, Stock market price prediction etc.

0_8UFvupmt22pOcRdH
Data of a coffee shop sales. The red dots represent the data whereas green line shows the prediction.
  • Classification problem:

We can say a supervised learning problem is classification problem when the output is discreet wrt the input.

Example: Titanic survival prediction , Gender Classifier etc.

1_9Tsi-lsA2h0SEm0zrVMrng
Hopefully, this would clear up a bit more. 

Before finishing supervised learning let’s list some of the popular supervised machine learning algorithms:

  • Linear regression
  • Support Vector Machine(SVM)
  • Decision Tree
  • Logistic Regression
  • K-Nearest Neighbors (K-NN)
  • Neural Networks

We would be discussing these algorithms in detail in future. So That’s it for supervised learning, for now, let’s move to unsupervised learning.

What is unsupervised learning?

Unsupervised learning is where you only have input data (X) and no corresponding output variables. These are called unsupervised learning because unlike supervised learning above there are no correct answers :P.

Unsupervised learning problems can be further grouped into:

  • Clustering: A clustering problem is where you want to discover the inherent groupings in the data, such as grouping customers by purchasing behavior.
1200px-Cluster-2.svg
The data here can be seen to be clustered into three groups.<Image Source>
  • Association: An association rule learning problem is where you want to discover rules that describe large portions of your data, such as people that buy A also tend to buy B.

Before finishing unsupervised learning let’s list some of the popular unsupervised machine learning algorithms:

  • K-Means Clustering
  • Hierarchical Clustering
  • Apriori Association Rule
  • Eclat Association Rule
  • Principal Component Analysis (PCA)

The PCA algorithm is used for converting high-dimensional data to low-dimensional data. This helps in data compression. It also allows us to visualize really high-dimensional data by compressing it to 2 or 3 dimensions and plotting it.

Some exciting applications of unsupervised learning include autoencoders, Generative adversarial networks etc. which are used to generate various kinds of data like images, music etc. Future posts will discuss these algorithms in detail. Let us move towards reinforcement learning.

What is reinforcement learning?

Reinforcement Learning is a paradigm of machine learning very different from supervised and unsupervised learning. Here, an agent learns from its past experiences to behave in an environment by performing actions and trying to get maximum rewards.

Fun fact, have you heard of the DeepMind’s AlphaGo which is the best Go player in the world?(It recently defeated the world’s best Go player!) It’s an implementation of Reinforcement learning. Check this link for more detail.

To illustrate above definition more clearly take an example of the Atari Breakout, (start by watching this video.)

ce35995cba5b821608f2635d54d7b621836dcebbbab3120d3e03c4d24dbc9782
Atari Breakout’s play screen

The objective of the game is to get maximum score by breaking all the blocks in minimum time. Here, the board is the “agent” that can move right or left (which are its “actions”) in the game “environment” to get the maximum score (which will be its “reward”). Thus when the game starts our agent knows nothing about the environment thus it learns by itself to hit the balls (finally after hours of training plays like a pro player XD) thus adapts itself through a constant hit and trial like humans do.

Hope this gives some intuition about the reinforcement learning.

To finish with, some popular reinforcement learning algorithms are:

  1. Q-Learning
  2. State-Action-Reward-State-Action (SARSA)

A Short Note on Ensemble Methods…

It is quite usual for different machine learning models to have varying performance on the same problem. One algorithm may have better training accuracy, while some others may excel in terms of validation accuracy or say, recall. We can utilize all of those models to get better overall performance on the problem! This is where ensembles come into picture. They basically combine outputs from various machine learning models and give a new output based on different models’ outputs. You can learn more about ensembles in this incredible blog post by Necati Damir.

That’s it for now, hope you enjoyed reading it. Do like, follow, share. Stay tuned for more. Also, don’t forget to follow us on Facebook for updates.

Explore all of the articles from ML Class >>

4 thoughts on “MLClass #1 : Types of Machine Learning Algorithms

Leave a comment