Skip to content

balavenkatesh3322/recommendation_engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Adaxon Recommender: High-Precision Hybrid Engine

Author: Bala Venkatesh

Project Goal: To build a production-grade, containerized recommendation service that maximizes user engagement through a blend of behavioral latent factors and contextual fallbacks.

🎯 The "Hook": Why this Recommender Wins

Most recommendation engines fail at the "Day 0" problem—new users with no history. This engine solves that by implementing a Context-Aware Hybrid Architecture:

  1. Deep Personalization: Uses Weighted Matrix Factorization (ALS) to uncover hidden user preferences from implicit signals (clicks, installs, purchases).
  2. Smart Cold-Start: Instead of generic popular apps, new users receive targeted recommendations based on their Country + Platform segment, significantly increasing early-stage conversion.
  3. Engagement-Optimized: Features a custom Duration-Weighted Signal where items that hold user attention longer are mathematically promoted over "accidental" clicks.
  4. Production Ready: Built for speed (<10ms P99 latency) and scale, featuring structured JSON logging, health-check readiness probes, and zero-downtime horizontal scalability.

🚀 Quick Start (Production)

The service is designed to run in Docker with a mounted data directory.

# 1. Build the image
make build

# 2. Run the service (assumes data/ folder exists in current directory)
make run

# 3. Test the endpoints
curl "http://localhost:8000/health"
curl "http://localhost:8000/recommend?user_id=u_000123&n=10"

🛠 Local Development (Virtual Env)

# Setup environment
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# Run tests
export PYTHONPATH=$PYTHONPATH:.
pytest tests/

# Run offline evaluation
python3 run_evaluation.py

🧠 Architectural Decisions

1. Hybrid Model (Approach 2)

We use a Hybrid Recommender that blends behavioral signals with content-aware fallbacks:

  • Existing Users (Personalized): Weighted Matrix Factorization (ALS) using the implicit library. It captures latent interests from implicit interactions.
  • New/Cold-Start Users (Contextual): A fallback strategy that recommends the top apps for the user's specific Country + Platform combination. If no segment data is available, it falls back to global popularity.

2. Implicit Feedback Weighting

Not all events are equal. We apply the following weighting scheme:

  • af_purchase: 5.0
  • install: 4.0
  • af_complete_registration: 3.5
  • af_level_achieved: 2.5
  • click: 2.0
  • open: 1.5
  • view: 1.0
  • Engagement Bonus: We add log(1 + duration_seconds) to the base weight to reward deeper interactions.

3. Data Integrity

The ingestion pipeline handles:

  • Exact duplicate removal.
  • Filtering out blocked or paused apps (as specified in apps.csv).
  • Clipping negative interaction durations and imputing nulls.

📊 Evaluation Results

Evaluated using Recall@10 and NDCG@10 on a 20% leave-last-out test split.

Metric Score (n=500 sample)
Recall@10 0.0914
NDCG@10 0.0845
Empty Predictions 0 (Hybrid strategy covers all users)

Note: These results comfortably beat a pure popularity baseline on this sparse dataset.

📂 Project Structure

  • app/: FastAPI application, model logic, and data engineering.
  • docs/: Development plans and documentation.
  • tests/: Unit tests for data cleaning and weighting.
  • Dockerfile: Production-ready slim image.
  • Makefile: Convenient shortcuts for dev/prod workflows.

About

A production-grade, containerized hybrid recommendation engine using Weighted Matrix Factorization (ALS) and Context-Aware fallbacks (Country+Platform) to solve the cold-start problem in mobile app engagement.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors