ElectroHub
Hybrid product recommender over 62,222 Amazon electronics, served by FastAPI behind a Next.js storefront.
Python · FastAPI · Next.js
screens
overview
A product recommender trained on the Amazon Reviews 2023 Electronics dataset: 119,173 shoppers, 62,222 products and about 1.18 million ratings. A FastAPI service loads the trained model and ranks the whole catalogue for a shopper, and a Next.js storefront shows the results, down to the score behind each pick.
The model blends two signals. The collaborative half is implicit-feedback ALS, which learns from what similar shoppers rated. The content half compares product titles, brands and categories with TF-IDF. Both halves are standardized before they are combined, so the blend weight really moves the ranking.
This project was first written under deadline in 2025 and rebuilt in 2026. The rebuild found that the original blend could not reorder anything, that serving code read content similarity for the wrong products, and that the evaluated model was not the one being served. Each of those now has a test that fails if it comes back.
Results are reported against baselines. At a 0.0183 hit rate at 10, the hybrid beats a popularity baseline (0.0163) and ties pure collaborative filtering (0.0180) within noise, and the storefront says so.
highlights
- Implicit-feedback ALS for ranking, bias-corrected SVD for rating prediction
- TF-IDF content similarity over product title, brand and category
- One scoring function shared by the API and the evaluation
- Leave-last-out evaluation against popularity and random baselines
- 96 tests, each tied to a defect the project actually had
- Storefront page that explains each recommendation's score to a visitor
stack
Model
NumPy SciPy scikit-learn pandas
Serving
Python 3.13 FastAPI Uvicorn Pydantic
Frontend
Next.js 15 React 19 TypeScript Tailwind CSS
Data
Amazon Reviews 2023, Electronics Parquet
Testing
pytest httpx