Skip to content

steffegit/song-recommendation-system

Repository files navigation

🎼 Hybrid Music Recommendation System (ML & Optimization)

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.


📄 Overview

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:

  1. Semantic NMF (Latent Discovery): Extraction of semantic features and hybrid diversity filtering.
  2. Playlist Creator (Acoustic Optimization): Playlist generation under time constraints (20 min) using convex projections on linear half-space.
  3. 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).

🛠️ Tech Stack & Algorithms

  • 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 Structure

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.

🚀 User Workflow (How to run the project)

1. Installation & Launch

git clone https://github.com/steffegit/song-recommendation-system.git
cd song-recommendation-system
python final_gui.py

2. Step by Step in the Interface

Tab 1: Semantic Discovery (NMF)

  • Step 1: Enter a valid Song ID (e.g., 41 for 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.

Tab 2: Acoustic Optimization (Playlist Creator)

  • 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.

Tab 3: Playlist Completion (Elastic Net)

  • 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.

👨‍💻 Authors

Development team:


🔗 If this project was useful in your optimization research, give us a ⭐!

About

A modular system that delivers personalized music recommendations using non-negative matrix factorization (NMF) and advanced optimization techniques. It generates playlists or song suggestions by uncovering hidden patterns in the song–tag matrix.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages