Predict EPL results (Part 2: Neural Network example)

Neural Network explained

  • Artificial Neural Network is a model that receives input in vector/matrix form and uses them to compute the output 
  • It is made up of 3 different layers namely input layer, hidden layer and output layer. 
  • Each layer is made up of 1 or more artificial neurons (aka nodes) 
    • The nodes are interconnected with one another
    • Each node is assigned to a weight value denoted by w that determines how much emphasis is given to the learned information extracted from the raw training data 
  • Note: A Neural Network with 1 hidden layer is known as Shallow Neural Network

Types of Neural Networks

  1. Feedforward Neural Network
  2. Convolutional Neural Network (CNN)
  3. Recurrent Neural Network - Long Short Term Memory (LSTM) Networks
  4. Recursive Neural Network

Neural Network Architecture

  • The figure below shows a Neural Network Architecture that is made up of features, h hidden layers and output values
    • The number of hidden layers is a hyperparameter that is set by us and we can change it to fine tune the performance of the model
    • If we are solving binary classification problem (i.e. y = 0 or 1), there will be only 2 nodes in the output layer
    • If we are dealing with multiclass classification problem (i.e. EPL prediction), there will be 3 nodes in the output layer
  • Let's take the EPL data that we used for our Logistic Regression model as an example
    • Recall that there are 
      • 280 training set 
      • 100 test set
      • 16 features (n = 16)
      • 3 output values (i.e. win, draw and lose) (y = 3)
    • Therefore, for every example, the input layer will have 16 nodes to represent the features (x1x2x3, ... , x16) and the output layer will have 3 nodes to represent the possible outcomes. We can choose the number of hidden layers that we want

Neural Network Architecture

How does Neural Network learn? 

Before we start, let's go through some notations as shown in the picture below.

Notation
Notation

Shallow Neural Network Model

Shallow Neural Network Model
Shallow Neural Network Model

Forward Propagation

Forward Propagation
Forward Propagation


Backward Propagation

  • Helps to reduce error thus optimizing the cost of the function

Analysis of our NN model

  • We included the rest of the seasons data and still using 16 features
  • We built a NN model with 1 hidden layer with 4 nodes and here's our results
    • Train accuracy = 67% 
    • Test accuracy = 64%
  • The gap between train and test accuracy has closed up a lot so there's no need for us to do regularization

What's next

  • We are going to find ways to further improve the accuracy (e.g. change the model, add more features etc)
  • And we are going to build an interface to use the trained parameters so that we can use it to predict the new game
  • And also we are going to learn Tensorflow 2.0 (heard it's easier now) and Keras 

Comments

Popular posts from this blog

How to connect Python to MySQL Workbench

Bias and Variance in Machine Learning