Vehicle Insurance Eligibility Prediction & MLOps Pipeline
Project Type
Objective
Built an end-to-end MLOps pipeline to predict whether a client should be offered vehicle insurance based on personal details, vehicle attributes, and historical claim data. The project focused on turning a machine learning model into a reproducible production-style system by building data validation, preprocessing, model training, version control, API deployment, and CI/CD workflows. The final pipeline uses FastAPI for real-time predictions, DVC for data and model versioning, and AWS EC2 for cloud deployment.
Tools & Technologies
Project Details
Problem: Insurance eligibility decisions depend on multiple customer and vehicle risk signals, including demographic details, vehicle attributes, prior insurance behavior, and historical claim patterns. If these inputs are handled manually or inconsistently, eligibility decisions can become slow, difficult to reproduce, and hard to deploy as a reliable prediction service. Goal: This project built an end-to-end MLOps pipeline that predicts whether a client should be offered vehicle insurance and packages the model into a reproducible, deployable, and version-controlled machine learning system.
Data Scope: The project used structured insurance-related data containing customer attributes, vehicle details, and historical claim information. Business Use Case: The model was designed to support insurance eligibility screening by estimating whether a client is likely to be eligible for a vehicle insurance offer. Decision Context: Instead of only building a notebook model, the project focused on creating a repeatable ML workflow that could support real-time prediction through an API.
Validation: I added checks to verify input data quality before model training and prediction. This included reviewing missing values, incorrect data types, invalid categories, and inconsistent records. Cleaning: I cleaned and standardized customer, vehicle, and claim-related fields so the downstream model could learn from consistent structured inputs. Purpose: This step ensured the pipeline was not dependent on manually cleaned files and could support a more reliable production-style workflow.
Feature Preparation: I transformed raw customer, vehicle, and claim-history fields into model-ready features. Categorical Handling: Categorical variables were encoded so the model could process fields such as vehicle type, customer category, or insurance-related attributes. Numerical Processing: Numerical fields were cleaned and prepared for training, including handling missing values and scaling or transformation where required. Pipeline Design: The preprocessing logic was structured as part of the ML pipeline so the same transformations could be reused during both training and inference.
Training Task: The project was framed as a supervised classification problem where the model predicts whether a client should be offered vehicle insurance. Modeling Workflow: I trained machine learning models using the prepared feature set and evaluated their performance on held-out data. Selection Focus: The goal was not only to build a model with strong predictive performance, but also to create a model artifact that could be versioned, loaded, and served through an API.
Why DVC: I used DVC to bring version control discipline to the machine learning workflow. This helped track data files, model artifacts, and pipeline outputs separately from regular source code. Reproducibility: DVC made the workflow easier to reproduce by maintaining links between datasets, preprocessing outputs, trained models, and pipeline stages. MLOps Value: This ensured that model development was not just experimental, but organized in a way that supports repeatable training and controlled model updates.
Prediction Service: I built a FastAPI application to serve the trained model as a real-time prediction API. Inference Flow: The API accepts client and vehicle information, applies the required preprocessing steps, loads the trained model, and returns an insurance eligibility prediction. Production Focus: This converted the project from a local ML experiment into a service-oriented application that can receive requests and return predictions programmatically.
Cloud Deployment: I deployed the FastAPI application on an AWS EC2 instance so the model could be accessed as a running service. Server Setup: The deployment involved preparing the cloud environment, moving the application code and model artifacts, configuring runtime dependencies, and running the API service on the instance. Outcome: This demonstrated the end-to-end path from training a model locally to serving predictions through a cloud-hosted API.
Automation Goal: I added CI/CD workflow practices to make the project easier to update, test, and redeploy. Pipeline Focus: The workflow supported version-controlled code changes, model pipeline updates, and deployment automation steps. Engineering Value: This made the project closer to a real MLOps system where code, data, models, and deployment artifacts can be managed in a controlled lifecycle.
Outcome: The final project delivered a complete MLOps workflow for vehicle insurance eligibility prediction, including data preprocessing, model training, DVC-based versioning, FastAPI inference, and AWS EC2 deployment. Key Learning: The project demonstrated how machine learning work becomes more valuable when it is reproducible, deployable, and maintainable rather than limited to notebook-based experimentation. Practical Value: The system shows how insurance eligibility screening can be supported through a production-style ML pipeline that connects model development with real-time prediction infrastructure.