December 2018
Intermediate to advanced
158 pages
3h 58m
English
Once a model has been built and trained, it is common to want to save the model's state. This is not so important in cases like this, when training takes an insignificant amount of time. However, with large datasets, and many parameters, training can potentially take hours our even days to complete. Clearly, we do not want to retrain a model every time we need it to make a prediction on new data. To save a trained model's parameters, we simply run the following code:
![]()
The preceding code saves the model using Python's inbuilt object serialization module, pickle. When we need to restore the model, we can do the following:
Note ...
Read now
Unlock full access