A modular ecosystem consisting of three advanced applications that combine Non-negative Matrix Factorization (NMF) with Constrained Convex Optimization to generate high-precision music recommendations.
The system transforms raw interactions (Song-Tag Matrix) into latent features, using a mix of Machine Learning techniques and optimization algorithms written from scratch. The project includes an intuitive graphical user interface (GUI), divided into three technological pillars:
- Semantic NMF (Latent Discovery): Extraction of semantic features and hybrid diversity filtering.
- Playlist Creator (Acoustic Optimization): Playlist generation under time constraints (20 min) using convex projections on linear half-space.
- Song From Playlist (Elastic Net Completion): Identification of the missing song from a playlist using a manual PGD solver for Elastic Net cost function minimization (L1/L2).
- Core: Python 3.x, NumPy, Pandas
- Dimensionality Reduction: NMF (Non-negative Matrix Factorization)
- Optimization Engine (Manual Implementation):
- PGD (Projected Gradient Descent) with projections on half-space and unit hypercube.
- Accelerated PGD (Nesterov's Method) for fast convergence.
- ALS (Alternating Least Squares) and NNLS (Non-Negative Least Squares).
- UI: Tkinter (Custom "Clam" Theme)
- Visualization: Matplotlib (Real-time convergence graphs)
| File | Responsibility |
|---|---|
final_gui.py |
Entry point. Manages the interface, data flow, and module integration. |
MusicRecommender.py |
Core of Tab 1. Implements NMF logic and MMR (Maximal Marginal Relevance). |
PlaylistCreator.py |
Optimization engine for Tab 2. Includes manual solvers (PGD, ALS) and convex projections. |
SongFromPlaylist.py |
Logic for Tab 3. Implements iterative solver for Elastic Net distance (L1/L2). |
music_info.csv |
Dataset containing song metadata and acoustic attributes. |
model_W.npy |
Pre-trained latent component matrix through NMF. |
git clone https://github.com/steffegit/song-recommendation-system.git
cd song-recommendation-system
python final_gui.py- Step 1: Enter a valid Song ID (e.g.,
41for the song Time Is Running Out by Muse). - Step 2: Choose the desired filtering method: Tags, NMF, or Hybrid.
- Result: The system will return thematically similar songs.
- Diversity: The algorithm applies diversity rules to ensure a balanced mix, avoiding lists dominated by a single artist.
- Step 1: Select a reference song (ID) to define the acoustic profile of the playlist.
- Step 2: Choose an ML Solver from the list. We recommend using PGD or Accelerated PGD to observe the mathematical efficiency of the algorithms.
- Step 3: Press the generate button. You will receive a 5-song playlist that respects the 20-minute time limit.
- Analysis: Monitor the Convergence Graph to see how the algorithm navigated the search space to find the global optimum.
- Step 1: Press the button to generate a Base Playlist (Random).
- Step 2: Run PGD Optimization. The system will mathematically "sculpt" the attributes of the ideal missing song from the current context.
- Step 3: The algorithm searches the database for the song that minimizes the Elastic Net (L1/L2) error against the calculated optimal profile.
- Validation: Monitor the Loss Graph (loss decrease) to validate the model's learning process.
Development team:
- Potop Horia-Ioan — @horicuz
- Gatej Ștefan-Alexandru — @steffegit
🔗 If this project was useful in your optimization research, give us a ⭐!