Real-Time Health Insurance Cost Estimator
"Stop waiting for quotes. Get your health insurance estimate in 30 milliseconds, not 30 minutes."
RiskRate AI is a modern, high-performance dashboard that provides instant health insurance premium estimates. By bridging the gap between Data Science and Frontend Engineering, this project transforms a standard Python regression model into a responsive, interactive web application.
Traditional insurance quotes require lengthy forms and backend processing. RiskRate AI flips the script:
- Zero Latency: The Machine Learning model is embedded directly into the frontend.
- Interactive UX: Prices update instantly as users drag sliders or toggle switches.
- Visual Feedback: Dynamic color-coding for BMI risk levels and smooth number animations.
- Frontend: React 18 (via Vite) for high-performance rendering.
- Styling: Custom CSS Design System (No frameworks like Bootstrap/Tailwind).
- Why? To demonstrate mastery of CSS variables, flexbox/grid layouts, and responsive design without relying on pre-built components.
- Machine Learning: Linear Regression (trained on the Medical Cost Personal Datasets).
- Architecture: "Edge AI" approach—weights extracted from Python and hardcoded into the client-side logic for O(1) inference time.
Instead of a heavy backend API, I reverse-engineered the regression model to run purely in the browser.
The Equation:
The Weights (Derived from Python):
-
Base Bias (
$b$ ):-12,105.48 -
Smoker Penalty:
+$23,810.32(The dominant factor) -
Age Factor:
+$257.83/ year -
BMI Factor:
+$321.94/ unit -
Children:
+$473.69/ child
A clean, modern interface separating inputs (Left) from results (Right), optimized for both desktop and mobile.
- Age Slider: Restricts input to insurable ages (18-65).
- BMI Visualizer: The slider track changes color (Blue → Green → Yellow → Red) to visually indicate health risk categories (Underweight to Obese).
- iOS-Style Toggles: Premium feel for binary choices like "Smoker".
The "Estimated Annual Premium" card isn't just static text. It features a custom AnimatedNumber component that interpolates values smoothly, giving the app a "living" feel.
-
Clone the repository
git clone https://github.com/natinew77-creator/RiskRate-AI.git cd RiskRate-AI/risk-rate-ai -
Install Dependencies
npm install
-
Run Locally
npm run dev
Open
http://localhost:5173to view the app.
Disclaimer: This application is for educational purposes. The estimates are based on a public dataset and do not constitute real financial advice.