Welcome to the Insurance Cross-Selling Prediction project! The goal of this project is to predict which customers are most likely to purchase additional insurance products using a machine learning model.
Below is the architecture diagram that illustrates the flow of the project from data ingestion to model deployment:
To get started with the project, follow the steps below:
Clone the project repository from GitHub:
git clone https://github.com/prsdm/ml-project.git
cd ml-project
Ensure you have Python 3.8+ installed. Create a virtual environment and install the necessary dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
Alternatively, you can use the Makefile command:
make setup
Pull the data from DVC. If this command doesn't work, the train and test data are already present in the data folder:
dvc pull
To train the model, run the following command:
python main.py
Or use the Makefile command:
make run
This script will load the data, preprocess it, train the model, and save the trained model to the models/ directory.
Start the FastAPI application by running:
uvicorn app:app --reload
To build the Docker image and run the container:
docker build -t my_fastapi .
docker run -p 80:80 my_fastapi
Once your Docker image is built, you can push it to Docker Hub, making it accessible for deployment on any cloud platform.
Integrate Evidently AI to monitor the model for data drift and performance degradation:
run monitor.ipynb file