finalyearproject: PredictIQ: The MLOps Repo That Treats Customer Prediction Like a Production System

From raw retail transactions to segmentation, explainability, drift detection, and live prediction streams, this project builds the whole loop, not just the model.

8 to 10 min read • View on GitHub • More from dhruvmkolhe

A wide production machine turns messy retail records into a monitored prediction system. On the left are receipts, customer rows, and raw data sheets. In the center are chambers for preprocessing, feature engineering, training, explainability, and drift monitoring. On the right, a dashboard, alert bell, and live output stream emerge as the finished system. It explains that PredictIQ is built as an operational loop, not a single model.
PredictIQ is best understood as a loop. Data comes in, models make predictions, and monitoring decides whether those predictions still deserve trust.
Key Takeaways

A customer model that behaves like a product

PredictIQ is not trying to be a prettier segmentation notebook. It is organized like a customer intelligence system that can ingest data, shape features, train models, serve predictions, and watch for drift after deployment.

That matters because most ML demos stop at the moment the model is saved. This repo keeps going. It treats prediction as a business process, not a one-time experiment.

The result is a rare kind of student project: a full loop with enough discipline to resemble a real internal tool. That is the hook.

Why this repo feels more mature than a typical final-year project

The structure is the story. PredictIQ separates data, modeling, serving, and monitoring so the system can evolve without collapsing into one script.

The repo’s folder structure signals intent. Backend, frontend, pipeline, monitoring, data, and models are split into separate concerns, which is exactly what you want when a project claims to do more than offline training.

The stack is also unusually complete. FastAPI, WebSockets, Redis, PostgreSQL, Docker Compose, Grafana, and test files all show up together, which tells you this was built as a service, not a notebook export.

That is the big difference. A lot of projects can predict. Far fewer can survive deployment, observability, and repeated use.

The feature engineering is the real intelligence layer

A close-up workshop scene shows retail transactions passing through a cleaning tool and into several gear trains. One gear train represents RFM, another return-rate parsing, and another monthly frequency. Small gauges labeled with model metrics sit beside the output, showing that feature quality and model quality are connected. It explains how the system turns messy data into behavioral signal before training begins.
The real work happens before training. PredictIQ shapes raw retail events into features that reflect behavior, not just volume.

This is where the repo stops looking generic. It goes beyond standard RFM scoring and builds a richer behavioral feature space, including return-rate parsing and monthly purchase frequency, alongside outlier handling with IQR.

That feature layer is the hidden thesis of the project. If the inputs are sloppy, the model becomes a costume. If the inputs are behavioral, the model can start to mean something.

The README and pipeline notes suggest a 9-dimensional feature set, which is enough structure to support segmentation and supervised prediction without collapsing into a toy example.

How it chooses models instead of just training them

StepPredictIQ approachTypical notebook project
SegmentationCompares K-Means, DBSCAN, and hierarchical clusteringRuns one clustering method and calls it a day
EvaluationUses silhouette and elbow analysis to compare behaviorShows a cluster plot without much justification
ClassificationTrains multiple models, including a stacking ensembleFits a single classifier and reports accuracy
Imbalance handlingUses SMOTE and favors MCC and ROC-AUCIgnores class imbalance or optimizes for raw accuracy
Decision-makingSelects models with downstream use in mindStops at the best-looking validation number

The model strategy is more disciplined than the average project. Instead of treating one algorithm as destiny, PredictIQ compares clustering methods and then trains multiple classifiers for the supervised side.

The important part is the metric choice. Accuracy is a weak hero in imbalanced retail problems. By emphasizing MCC and ROC-AUC, the repo shows it understands that a model can look good and still be useless.

SMOTE and stacking round out that story. The project is not chasing novelty. It is trying to make weak signals reliable enough to act on.

The surprising part: prediction is live, stateful, and explainable

PredictIQ is not just exposing an API. It behaves more like a prediction server, with WebSocket streaming for live outputs and SHAP support for per-customer explanation.

That combination matters. A dashboard that says a customer is likely to churn is useful. A system that can also explain which features pushed that decision is much closer to something a business user can work with.

The backend choice reinforces the point. FastAPI plus WebSockets gives the project a live feel, while SHAP keeps the model from becoming a black box with a nice UI.

The strongest enterprise systems do not just answer queries. They answer queries and tell you how much trust to place in the answer. That is the bar this repo is aiming for.

Why drift detection is the most important enterprise feature here

PSI is the quiet centerpiece of the project. It compares the distribution of live production data with the training baseline, which is how a system catches model rot before users do.

That is a much bigger deal than it sounds. A model that works on Monday and drifts by Friday is not a deployed product. It is an expired assumption.

By wiring drift detection into the workflow, PredictIQ shifts from prediction to stewardship. That is the difference between a demo and an operating system for decisions.

What PredictIQ does better than the usual notebook-to-dashboard path

CapabilityPredictIQCommon notebook project
IngestionStructured pipeline from raw retail dataManual file loading in a notebook
Feature engineeringBehavioral features and outlier handlingBasic columns with light cleanup
ServingFastAPI and WebSocket prediction flowStatic notebook output or batch CSV
ExplainabilitySHAP-based individual prediction contextNo explanation beyond a score
MonitoringPSI drift detection and alertsNo post-deployment visibility
Retraining readinessExplicit loop back into the systemModel saved once and forgotten

PredictIQ is valuable because it closes the loop. The repo does not just produce a model artifact. It builds the machinery around the artifact so the model can be used, inspected, and eventually replaced without starting over.

That is the quiet standard this project meets. It is not flashy because it has more algorithms. It is compelling because it behaves like software that expects to keep running.