A hybrid recommendation system built using the LightFM library to recommend Points of Interest (POIs) in Lahore, Pakistan.
This repository contains the source code, data, and documentation for a project that processes spatial place data, simulates user interaction demographics, and trains a hybrid collaborative filtering model.
lahore-poi-recommender/
├── data/
│ ├── pakistan_gazetteer_data.xlsx # Raw Pakistan Gazetteer dataset
│ ├── lahore_locations_data.csv # Filtered POI data from the Pakistan Gazetteer
│ └── generated_users_data.csv # Simulated user demographics and interaction history
├── docs/
│ ├── presentation.pdf # Project presentation slide deck
│ └── report.pdf # Detailed project report
├── lahore_poi_recommender.ipynb # Jupyter Notebook containing the full pipeline
└── README.md
The project is structured into three main phases, all contained within lahore_poi_recommender.ipynb:
- Data Extraction & Filtering:
- Filtered national spatial data to extract Lahore's coordinates.
- Categorized locations into relevant feature classes (e.g., Parks, Mosques, Monuments, Shrines, Libraries).
- User Simulation:
- Generated synthetic profile data for 5,000 users.
- Assigned demographics (age, gender) and category preferences.
- Built simulated visit histories (10–20 visited locations per user) to train the model.
- Model Training & Evaluation:
- Built a Hybrid Recommender System using the LightFM algorithm.
- Incorporated user features (gender, binned age groups) and item features (feature classes/codes)
- Evaluated using ranking metrics: Precision@k, Recall@k, and AUC Score.
To run the notebook locally, install the following Python packages:
pip install pandas numpy lightfm scikit-learn openpyxl- Clone this repository.
- Open lahore_poi_recommender.ipynb in Jupyter Notebook or Google Colab.
- Run all cells in order. The notebook is fully self-contained and runnable from start to finish, including the initial coordinate filtering of the raw gazetteer data (
data/pakistan_gazetteer_data.xlsx).
The hybrid model achieves the following typical validation metrics on the simulated interaction data:
- Precision@5:
~0.33 - Recall@5:
~0.11 - AUC Score:
~0.70