GitHub - Dhruvnet/Recommendation_System_Pipeline · GitHub
Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

Event Recommendation Pipeline

Overview

This project implements an end-to-end event recommendation pipeline designed to retrieve and rank relevant activities for users based on preferences, event metadata, and ranking signals.

The system demonstrates how real-world recommendation systems are structured, including:

  • Data ingestion and preprocessing
  • Feature engineering
  • Candidate retrieval
  • Ranking
  • Offline evaluation
  • API serving
  • Interaction logging

The pipeline operates on structured event datasets and simulated user interactions.


System Architecture

The system is divided into three main stages:

1. Offline Pipeline (Model Building)

  • Load events from database
  • Generate text and structured features
  • Build hybrid feature vectors
  • Build FAISS index for retrieval
  • Save artifacts for serving

Output artifacts:

  • TF-IDF vectorizer
  • Feature scaler
  • FAISS index
  • Metadata
  • Hybrid feature matrix

2. Online Serving Layer

  • REST API built using Flask
  • Accepts user_id and optional filters
  • Retrieves candidates using FAISS
  • Applies ranking logic using:
    • Similarity score
    • Recency
    • Popularity
    • User preferences
  • Returns ranked recommendations

3. Interaction Logging & Evaluation

  • Logs user interactions (click/no-click)
  • Computes offline metrics:
    • Precision@K
    • Recall@K
    • NDCG
    • MAP
    • CTR (offline simulation)

Database Schema

Events

Stores event metadata used for recommendation.

Fields:

  • event_id
  • event_name
  • event_type
  • start_time
  • end_time
  • date
  • event_location
  • seats_available
  • description

Derived features:

  • timing bucket (Morning/Afternoon/Evening/Night)
  • recency score
  • popularity score

Users

Stores user preferences.

Fields:

  • user_id
  • preferred_types
  • preferred_timings
  • preferred_duration

Interactions

Stores behavioral signals.

Fields:

  • interaction_id
  • user_id
  • event_id
  • clicked
  • timestamp

Feature Engineering

The system uses a hybrid feature approach:

Text features:

  • Event type
  • Name
  • Description
  • Location

Structured features:

  • Seats (normalized)
  • Recency
  • Timing bucket

Hybrid vector


Retrieval and Ranking

Candidate Retrieval

  • FAISS index
  • Vector similarity search

Ranking Signals

Final ranking score combines:

  • Similarity
  • Popularity
  • Recency
  • Seat availability

Offline Evaluation

Ranking quality is evaluated using:

  • Precision@K
  • Recall@K
  • NDCG
  • MAP
  • CTR (simulated)

Evaluation is performed using:

  • Ground-truth preferences
  • Interaction logs

Example API Request

POST /recommend

{
  "user_id": 3
}
{
  "user_id": 3,
  "event_types": ["Tech Meetups"],
  "timings": ["Evening"]
}
{
  "latency_ms": 65,
  "results": [...]
}

Separation of Concerns

The system separates:

  • Storage layer (SQLite)
  • Retrieval layer (FAISS)
  • Ranking layer
  • API layer
  • This mirrors production recommender architectures.

Limitations

  • Uses simulated interactions instead of real user behavior
  • Small user population
  • No online learning or retraining loop
  • No geographic distance ranking yet

Future Improvements

  • Collaborative filtering
  • User embeddings
  • Location-aware ranking
  • Real-time feedback loop
  • Periodic model retraining
  • A/B testing framework

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages