Model.save can I save class/label mappings?

Using model.save() I am able to save the trained model. However, upon using the model for predictions, I still need to recover the respective class/label mappings (0: 'cat', 1: 'dog' ... etc.). I wonder if there is a simpler way of saving the class information i.e. saving it inside the model file.

Hi @Francesca_Pisani,

Before saving the model, you can save the class/label mappings to a separate file using a suitable format like JSON, CSV, or Pickle. This way, you can load the mappings alongside the model when needed.

I hope this helps!

Thanks.