Using ML models with Joblib
ML models are powerful tools for data analysis, prediction, and decision-making in various applications. FastAPI provides a robust framework for building web services, making it an ideal choice for deploying ML models in production environments. In this recipe, we will see how to integrate an ML model with FastAPI using Joblib, a popular library for model serialization and deserialization in Python.
We will develop an AI-powered doctor application that can diagnose diseases by analyzing the symptoms provided.
Warning
Note that the diagnoses provided by the AI doctor should not be trusted in real-life situations, as it is not reliable.
Getting ready
Prior knowledge of ML is not mandatory but having some can be useful to help you follow the recipe.
We will apply the recipe to a new project, so create a folder named ai_doctor
that we will use as the project root folder.
To ensure that you have all the necessary packages in your environment...