Insurance Premium API
Trained a model on insurance data, then wrapped it in a FastAPI service so it can actually answer requests instead of sitting in a notebook.
The model worked fine locally. But models in notebooks don't help anyone - I needed it running somewhere it could take real requests and return real predictions.
- Built the API with FastAPI - loads the model on startup, takes a policy record, returns a premium prediction.
- Tested it with curl and Postman before calling it done. The model isn't fancy (Random Forest), but the pipeline works.
- Policy dataset
- Scikit-learn
- Joblib dump
- FastAPI
- JSON endpoint
- Endpoint
- POST /predict
- Input
- JSON policy record
- Output
- Premium estimate (float)
- Latency
- ~50ms per request