Data Science with Python by Rohan Chopra

Data Science with Python by Rohan Chopra

Author:Rohan Chopra
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2019-07-08T16:00:00+00:00


To understand, check out the output.

Figure 5.17: Least error

Note

The final model parameters that work best for this dataset:

Max depth = 9

Learning rate = 0.01

Number of rounds = 496

Saving and Loading a Model

The last piece in mastering structured data is the ability to save and load the models that you have trained and fine-tuned. Training a new model every time we need a prediction will waste a lot of time, so being able to save a trained model is imperative for data scientists. The saved model allows us to replicate the results and to create apps and services that make use of the machine learning model. The steps are as follows:

To save an XGBoost model, you need to call the save_model function.model.save_model('wholesale-model.model')



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.