Skip to content

Symfa-Inc/insurance-pricing

Repository files navigation

Insurance Pricing Logo

Insurance Pricing Assistant

Python 3.13 TypeScript FastAPI Next.js React AutoGluon SHAP OpenAI Docker

Full-stack ML application for estimating annual insurance charges with SHAP-based explainability and LLM-powered interpretation.

Live Demo · GitHub · Confluence

Preview

Insurance Pricing Preview

Features

  • Insurance Charges Prediction – AutoGluon tabular regression estimating annual insurance costs from demographic and health factors
  • SHAP Explainability – Per-prediction feature contributions showing how each input affects the estimated charge
  • LLM Interpretation – Human-readable explanation of predictions with headline, key factors, and caveats via OpenAI
  • Extrapolation Warnings – Alerts when input values fall outside the model's training distribution
  • Model Evaluation – Built-in reports with R², MAPE, and SMAPE metrics and business interpretation
  • EDA Reports – Automated exploratory data analysis with visualizations in Markdown format

How It Works

The system uses an AutoGluon TabularPredictor trained on the US Health Insurance Dataset (1,300 records with age, sex, BMI, children, smoker status, and region). When a user submits parameters, the backend runs the prediction, checks for extrapolation beyond training bounds, computes SHAP feature contributions using a TreeExplainer, and generates a structured interpretation via GPT-4o-mini. The interpretation includes a headline, bullet-point explanations of key cost drivers, and caveats about model limitations.

Tech Stack

Category Technologies
Backend Python 3.13, FastAPI, Uvicorn
Frontend TypeScript, Next.js, React, Tailwind CSS
AI/ML AutoGluon, SHAP, OpenAI
Data pandas, NumPy, scikit-learn, Pydantic
Package Management uv (backend), pnpm (frontend)
Deployment Docker, GitHub Actions, Google Artifact Registry

Getting Started

Prerequisites

  • Python 3.13+ / uv
  • Node.js 24+ / pnpm

Installation & Running

# Backend
cd backend
cp .env.example .env          # Add your OpenAI API key
uv sync
uv run uvicorn insurance_pricing.main:app --reload

# Frontend
cd frontend
pnpm install
pnpm dev

Open http://localhost:3000 (frontend) and http://localhost:8000/docs (API docs).

License

MIT

About

Transparent AI for insurance pricing: Predicts premiums and explains "why" using SHAP and natural language summaries.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors