Fitting Untrained Models Workout
- 01:13
How to train and tune multiple models using a for loop in a Jupyter notebook.
Downloads
No associated resources to download.
Glossary
Machine Learning Python training tuningTranscript
In your Jupyter Notebook, complete the following steps. First, write a for loop to train all of the models in your model's dictionary. Then after training each model print the key followed by is trained and tuned. If you run into a data convergence warning, just like your regression algorithm, don't be concerned. Your model will still work correctly. Also, be aware that executing this code cell trains all hyperparameter configurations for each model class and may take some time to complete. Be patient and don't be concerned if it takes a few minutes for your code to finish executing. So here I have a for loop that says, for every key in my model's dictionary, take that untrained model and use the fit function to fit the model using my input training data and my target training data. And then when you're finished, I want you to print this string that says that my model is trained and tuned. If your models are taking a long time to produce this message, don't worry if it takes up to five or even 10 minutes. The algorithms are processing thousands and thousands of rows of data and they're tuning dozens and dozens of hybrid parameter configurations. So it can take a while, but you should eventually see GB is trained and tuned at the very bottom of this output.