I wanted to answer a practical question: “roughly how much would insurance cost for someone with this profile?” I could’ve just looked up rate tables, but where’s the fun in that?
This is a small ML regression project — my first attempt at taking a model from training to a working web app.
Tech Stack
Python · Pandas · NumPy · Scikit-learn · Gradio
Live Demo
https://huggingface.co/spaces/SajibXD/insurance-cost-predictor

App interface preview.
How It Works
Input your age, BMI, smoking status, and a few other profile fields. The app preprocesses the data (handling categorical features, scaling numerics), runs it through a trained regression model, and spits out a predicted cost.
The UI is built with Gradio — I chose it because I wanted something that Just Works without spending a week on frontend code. Hugging Face Spaces handles the hosting.
What I Learned
- Feature preprocessing matters more than model choice. A clean pipeline with the right transformations beats a fancier model with sloppy inputs every time.
- Model metrics lie. You can have great looking R² scores and still get individual predictions that make no sense. Sanity-checking outputs is non-negotiable.
- Gradio is a cheat code for putting ML models on the internet fast. It’s not pretty, but it works and nobody’s judging your UI when the model itself is the interesting part.
What I’d Add Next
- Better input validation and edge-case handling (what happens when someone enters a negative age?)
- Prediction confidence intervals — knowing the model is unsure is useful information
- A mode to compare multiple regression models side by side so you can see how different approaches differ