Mushroom Classification Project part 5 — Saving our Model

Chiraag K V
2 min readJul 18, 2021

This article is a continuation of my previous article on data modelling and evaluation.

correction from previous blog: I tried quite a lot of things to get my model’s score lesser than 100% accuracy, but it didn’t work, so in this article, we will skip the hyperparameter-tuning part and see how to save and reload our model.

Saving our Model

In this project, we are dealing with very small amounts of data and a very small model that takes no more than a few seconds to train. Most of the time, the projects will have a lot of data and very complex models that take hours to train. In these cases, we need to save our progress by saving the patterns that the model has learnt.

Loading our model

Sticking to our case of having a big model, it is only practical that we should be able to use the patterns that we stored in order to save our time.

Predicting using our Loaded Model

Let’s see how our loaded model performs. Does it work just like the old one, or does it give different results?

As we can see, it gives the same results — 100% accurate. This is because it uses the same “weights” or patterns as our old model does.

With this, my friends, we have finished our Mushroom Classification project in its entirety (you could deploy this model using Streamlit or Flask, but that isn’t very helpful as this model needs a whole csv file as input, with a some data pre-processing).

Alright let’s recap what we have covered in this series of articles:

  • EDA
  • Data pre-processing
  • Modelling
  • Model Evaluation
  • Saving our Model

Okay, this is it for this one. See you the next time!

--

--