How arvin-art/recommendation_system works
Project Type and Purpose
• This is a lightweight full-stack web application with an embedded machine-learning component.
• Purpose: serve book recommendations via a simple REST/front-end interface, using precomputed collaborative-filtering models.
File Structure
• Top level:
• Procfile – indicates Heroku (or similar PaaS) deployment
• app.py – the web service (Flask/FastAPI) that loads models and exposes endpoints
• *.pkl – precomputed model artifacts:
– popular_new.pkl (baseline popularity model)
– pt_new.pkl (user-item pivot table)
– similarity_scores.pkl (item-item similarity matrix)
• requirements.txt – Python dependencies
• webdev.code-workspace – IDE config (VS Code)
• README.md – project description
README for Additional Insights
• Confirms collaborative filtering approach
• Suggests an offline data-preprocessing and model-training pipeline whose outputs are committed as pickles
a. Main Components
1. Offline Training Pipeline (external to this repo, feeds model store)
2. Model Artifact Store (pickled files in repo or a storage bucket)
3. Web Application (app.py)
4. Frontend / API Consumer (browser or other client)
5. Hosting Platform (Heroku or equivalent PaaS)
b. Relationships & Interactions
• Offline Pipeline → (outputs) → Model Artifact Store
• On startup, Web App loads pickles from Model Store
• Frontend or REST Client → (HTTP requests) → Web App
• Web App → (in-memory ML inference) → Recommendation Engine → (JSON/HTML) → Client
• Web App → (logs, metrics) → Monitoring (optional)
c. Architectural Patterns / Design Principles
• Micro-services lite: single-process service with clear separation of offline vs. online concerns
• Immutable model artifacts for reproducible inference
• Twelve-factor deployment via Procfile
d. Key Technologies
• Python (Flask or FastAPI)
• Pickle-serialized scikit-learn (or pandas) objects
• Heroku (Procfile) or similar PaaS
• Optional: GitHub Actions (CI/CD), Docker (not present but common)