Apart from exploratory data analysis and ranking the special team metrics, predictions using an AI model can turn out to be a game-changer for coaches and teams if it is correctly utilized.
That's why we decided to integrate machine learning in this project by creating an artificial neural network (ANN) and a simple linear regression model to predict future metrics using the given data.
The first step of our model training involved dividing the data into two sets. The training set and the testing set. The testing set is primarily used for model evaluation to see how well our model is performing.
Then we preprocessed and scaled the data between the range of 0 and 1 using Scikit-learn, a machine learning library for Python. Having large values can cause biases in our model. As a result, we normalized the data to fit into our model. Next, to build the neural network we utilized Tensorflow to import the Sequential and the Dense module. The Sequential module allows you to build the model layer by layer. And the Dense module is used to connect the layer to one another inside a network where we can define the number of neurons each layer should contain.
Our model also needs an activation function. The one that we are using for this project is the rectified linear activation function or ReLU.
ReLU is a linear function that will output the input directly if it is positive, otherwise, it will output zero. Lastly, to compile the model we integrated an optimizer for specifying the gradient descent and the loss function to evaluate how well our algorithm can model the given data.
The test data we set aside is used for evaluating our model on how accurate the predictions are performing.
There are two important criteria that came into play to determine how well our model is performing. The mean squared error (MSE), which is the measure of the differences between the predicted values and the actual values.
And the mean absolute error (MAE) to see on average how far we are off from our actual points.