Distracted Driver day 5 — Modelling and Evaluating
Hey! Welcome back. In my last blog, we found the ideal learning rate of the model using the LRScheduler. Today we are going to train a model with the ideal learning rate (0.0003) and see how it goes. if it goes well, we will build our final model which is trained on the whole dataset.
Experiment number 1
I retained the same architecture and changed only learning rate from 0.001 to 0.003. The model looked something like this:
The results of this model was astonishingly good. The model got an accuracy of 93.80%
I decided to move on with this model architecture and trained the model on the whole dataset.
Fitting the final model
Recreating the train and test data
Here, I removed the indexing in order to pass the whole dataset as the features and labels to train_test_split()
.
Fitting the model
I ran the same code as above, with a small change. I changed the data I was training and validating on from train_data
, val_data
to train_data2
, val_data2.
Hmmm… our final model seems to be performing worse than our previous model, but remember that we are validating the models on two different validation datasets. Let’s evaluate our previous model on val_data2
and see which model actually performs better.
Model Evaluation
I checked the accuracy of the previous model on the val_data2
dataset, and here are the results
From this, we can see that our model3 (which was fitted on only a part of the data) had an accuracy of 21.45%. We can easily conclude that our final model is the better one of the two models that we built today.
Conclusion
Alright! With this, I have finished this project and I now have a fully trained model. I hope you had fun reading my blogs. Bye!