Tuning your model with hyperparameter optimization
Machine learning models have many parameters that allow the developer to improve performance and control the model that they are using, providing leverage to better fit the data and production use cases. Hyperparameter optimization is the systematic and automated process of identifying the optimal parameters for your machine learning model and is critical for the successful deployment of such a system.
In the previous section, we identified the best family (in other words, LogisticRegression
) model for our problem, so now it's time to identify the right parameters for our model with MLflow. You can follow along in the following notebook in the project repository, Chapter04/gradflow/notebooks/hyperopt_optimization_logistic_regression_mlflow.ipynb:
- Importing dependencies: We will use the
hyperopt
library, which contains multiple algorithms to help us carry out model tuning:from hyperopt import tpe from hyperopt import...