ML / 05 · Model Deployment

Rental Price Model Deployment

Taking a trained rental-price prediction pipeline out of the notebook and into a real, callable service — the part of the ML lifecycle that most portfolio projects skip.

FlaskStreamlitDockerHugging Face Spacesscikit-learn Pipelinejoblib
REST APIbackend
Streamlitinteractive frontend
Dockercontainerized
Batch + onlineinference modes

The problem

A trained model sitting in a notebook can't be used by anyone else. The engineering problem here isn't training a better regressor — it's the unglamorous but essential work of making a model callable: a stable API contract, a usable interface for non-technical users, and a deployment path that survives beyond a single laptop.

Approach

The trained regression pipeline (a scikit-learn ColumnTransformer with median imputation and scaling, serialized with joblib) was wrapped in a Flask REST backend exposing a prediction endpoint, paired with a Streamlit frontend so a non-technical user can enter property attributes and get an instant price estimate. The whole stack was containerized with Docker and deployed to Hugging Face Spaces, supporting both single-record online inference and batch scoring.

What shipped

  • A versioned, serialized inference pipeline (rental_price_prediction_model_v1_0.joblib) decoupled from the training notebook
  • A Flask backend exposing the model as a REST endpoint, independent of the frontend
  • A Streamlit UI for interactive single-property price checks
  • Docker packaging so the same image runs identically in development and on Hugging Face Spaces
Key insight

The hardest part of this project wasn't the regression model — it was separating training code from serving code cleanly enough that the model could be swapped for a retrained version without touching the API or the frontend.

View source notebook ↗ Back to all projects