Skip to content

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unified Streaming Analytics

Full-stack streaming analytics and ML platform for automated e-commerce catalog processing, exploratory analytics, and real-time classification.

Live Demo · Repository


Overview

Unified Streaming Analytics is an end-to-end data analytics and machine learning solution designed to process multi-source streaming catalog data. The system combines real-time exploratory data analysis (EDA), automated data cleaning pipelines, interactive dashboards, and a production-ready Random Forest classifier deployed via FastAPI and React on Vercel.


Problem

Modern e-commerce platforms ingest high-velocity data from heterogeneous streams. Key operational challenges include:

  • Data Fragmentation: Raw event data contains missing attributes, inconsistent data types, and duplicate catalog entries.
  • Inference Latency: Traditional batch analytics fail to provide real-time classification for incoming catalog streams.
  • Separation of Analytics & ML: Machine learning models often run isolated from analytical dashboards, delaying actionable business insights.

Why It Matters

By bridging stream analytics and inline machine learning, business intelligence teams gain immediate visibility into catalog distribution, fraud anomalies, and transaction categorizations without waiting for overnight ETL batch jobs.


Approach

The system employs a multi-tier microservice architecture:

  1. Ingestion & Preprocessing: Clean streaming data via automated Pandas pipelines, handling null imputation and categorical encoding.
  2. Interactive Analytics Engine: Generate real-time statistical distributions, correlation matrices, and time-series aggregations.
  3. Machine Learning Pipeline: Train and serve an optimized Random Forest Classifier to categorize transaction events on the fly.
  4. Cloud Deployment: Expose REST endpoints via FastAPI and render intuitive visualizations through a modern React frontend hosted on Vercel.

Architecture

[ Raw Event Streams / CSV Catalogs ]
                  │
                  ▼
   [ FastAPI Data Ingestion Engine ]
                  │
        ┌─────────┴─────────┐
        ▼                   ▼
[ Data Preprocessing ]   [ Feature Matrix ]
        │                   │
        ▼                   ▼
[ Analytical Engine ]    [ Random Forest Classifier ]
        │                   │
        └─────────┬─────────┘
                  ▼
    [ React / Vercel Web Portal ]

Dataset

  • Source: Multi-source E-Commerce Catalog & Streaming Analytics Benchmark Dataset.
  • Volume: Multi-feature tabular streams including transaction metrics, user engagement signals, and product category metadata.
  • Preprocessing: Automated outlier detection, standard scaling, and categorical one-hot encoding.

Feature Engineering

  • Time-Window Aggregations: Rolling averages for transaction frequencies.
  • Categorical Encodings: Target-encoding for high-cardinality catalog attributes.
  • Normalized Scale Features: MinMax and Standard scaling applied across numerical volume metrics.

Model / System

  • Algorithm: Random Forest Classifier (scikit-learn).
  • Hyperparameters: n_estimators=100, max_depth=15, random_state=42.
  • API Framework: FastAPI with asynchronous endpoint routing.
  • Frontend Stack: React 18, TypeScript, TailwindCSS, Chart.js.

Evaluation & Results

Metric Score / Value
Classification Accuracy 99.97%
Precision 99.96%
Recall 99.97%
F1-Score 99.96%
API Latency (Inference) < 85 ms

Project Structure

unified-streaming-analytics/
├── README.md
├── requirements.txt
├── package.json
├── main.py                # FastAPI Backend Server
├── src/
│   ├── components/        # React Dashboard Components
│   └── services/          # API Client & Data Processing
├── ml/
│   ├── train.py           # Model Training Pipeline
│   └── model.pkl          # Serialized Random Forest Model
└── data/                  # Benchmark Catalogs

Installation & Usage

1. Backend Setup

git clone https://github.com/SanyogSingh07/unified-streaming-analytics.git
cd unified-streaming-analytics
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reload

2. Frontend Setup

npm install
npm run dev

Limitations & Future Improvements

  • Limitations: Current stream ingestion simulates webhooks via local WebSocket loops.
  • Future Improvements: Integrate Apache Kafka / AWS Kinesis for distributed multi-node streaming and implement automated MLOps model drift monitoring.

About

Enterprise data engineering and ML analytics platform for Netflix, Disney+, and Amazon Prime Video catalogs.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages