How ropdam/recommender_comparison works
Project Type and Purpose
• This is an experimental ML research pipeline for a Master’s thesis comparing three recommendation-engine algorithms (BPR, CFRNN, NCF) on MovieLens and Amazon datasets.
File-Structure Analysis
• Top-level scripts:
• Data_prep.py – data loading & preprocessing
• BPR.py, CFRNN.py, NCF.py – each model implemented as a class
• Evaluation.py – metrics computation & benchmarking
• visualize_results.py – produce plots/tables from evaluation outputs
• Helpers.py – shared utility functions (e.g., I/O, logging)
• Notebooks/Example – sample end-to-end run of all models
• Notebooks/Thesis – separate experiment notebooks (hyperparameter search, final results)
• Results/Plots & Results/Thesis – output artifacts (charts, thesis figures)
Key README Insights
• Describes the three algorithms with literature references.
• Data format requirements (user_id, item_id, datetime).
• Dependencies: pandas, numpy, tensorflow, etc.
Core Components
a. Main Components
• Data Sources: MovieLens CSV, Amazon CSVs
• Data Preparation Module (Data_prep.py)
• Model Modules:
• BPR Class (BPR.py)
• CFRNN Class (CFRNN.py)
• NCF Class (NCF.py)
• Shared Utilities (Helpers.py)
• Evaluation Module (Evaluation.py)
• Visualization Module (visualize_results.py)
• Orchestration Layer: Jupyter Notebooks (Example + Thesis)
• Results Storage: Results/Plots, Results/Thesis directories
b. Relationships & Data Flow
1. Raw data → Data_prep → cleaned/structured data
2. Cleaned data + Helpers → each Model Module (train/predict)
3. Model outputs → Evaluation Module → metrics & benchmark tables
4. Metrics → Visualization Module → plots & figures
5. Notebooks call each step in sequence and read/write from Results folders
c. Architectural Patterns & Principles
• Pipeline Pattern: clear, linear flow from raw data to final figures
• Modular Design: each algorithm isolated in its own class, reusable helpers
• Separation of Concerns: data prep, modeling, evaluation, visualization all decoupled
• Strategy Pattern: interchangeable recommendation algorithms behind a common interface
d. Key Technologies & Frameworks
• Data handling: pandas, numpy
• Deep learning: TensorFlow ≥ 2.1
• Experiment orchestration: Jupyter Notebook
• Utils: progressbar, multiprocessing, csv
Detailed Component Breakdown (to capture all architectural elements)
• Data Sources: MovieLens, Amazon (CSV files)
• Preprocessing Step: Data_prep.py
• Helper Library: Helpers.py (I/O helpers, logging, utilities)
• Model Implementations: BPR.py, CFRNN.py, NCF.py (each exposes train(), predict())
• Evaluation Engine: Evaluation.py (computes ranking metrics, supports hyperparameter search)
• Visualization Engine: visualize_results.py (generates plots stored in Results/Plots)
• Experiment Layer: Example/all_models.ipynb and Thesis/*.ipynb orchestrate end-to-end runs
• Output Artifacts: Results/Plots/*.png, Results/Thesis/*.pdf