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.
The system is divided into three main stages:
- 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
- REST API built using Flask
- Accepts
user_idand optional filters - Retrieves candidates using FAISS
- Applies ranking logic using:
- Similarity score
- Recency
- Popularity
- User preferences
- Returns ranked recommendations
- Logs user interactions (click/no-click)
- Computes offline metrics:
- Precision@K
- Recall@K
- NDCG
- MAP
- CTR (offline simulation)
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
Stores user preferences.
Fields:
- user_id
- preferred_types
- preferred_timings
- preferred_duration
Stores behavioral signals.
Fields:
- interaction_id
- user_id
- event_id
- clicked
- timestamp
The system uses a hybrid feature approach:
Text features:
- Event type
- Name
- Description
- Location
Structured features:
- Seats (normalized)
- Recency
- Timing bucket
Hybrid vector
- FAISS index
- Vector similarity search
Final ranking score combines:
- Similarity
- Popularity
- Recency
- Seat availability
Ranking quality is evaluated using:
- Precision@K
- Recall@K
- NDCG
- MAP
- CTR (simulated)
Evaluation is performed using:
- Ground-truth preferences
- Interaction logs
POST /recommend
{
"user_id": 3
}
{
"user_id": 3,
"event_types": ["Tech Meetups"],
"timings": ["Evening"]
}
{
"latency_ms": 65,
"results": [...]
}- Storage layer (SQLite)
- Retrieval layer (FAISS)
- Ranking layer
- API layer
- This mirrors production recommender architectures.
- Uses simulated interactions instead of real user behavior
- Small user population
- No online learning or retraining loop
- No geographic distance ranking yet
- Collaborative filtering
- User embeddings
- Location-aware ranking
- Real-time feedback loop
- Periodic model retraining
- A/B testing framework
