ML engineering project
MusicMap
MusicMap is an artist recommendation system that leverages machine learning clustering to discover musical similarity patterns. The application processes a dataset of artists and their features, applies K-Means clustering to group similar artists, and integrates with Spotify's API to provide track previews and related artist information. **System Architecture:** The system is built on a **Flask** web server that handles user requests and coordinates between the clustering model and external APIs. When a user searches for an artist, the backend queries a pre-trained K-Means clustering model to identify artists in the same cluster, representing similar musical characteristics. **Clustering Methodology:** Using **K-Means clustering** with artist feature vectors (extracted from musical attributes like genre, popularity, and audio features), the system groups artists into distinct clusters. This unsupervised learning approach identifies natural groupings in the music landscape without requiring labeled training data.  **Spotify API Integration:** The application authenticates with Spotify using **Client Credentials Flow** and fetches: • **Track Previews** - 30-second audio samples from the artist's top tracks • **Related Artists** - Spotify's own recommendation algorithm results for comparison • **Artist Metadata** - Images, follower counts, and genre tags **Dataset Processing:** The system loads and processes a CSV dataset containing artist features. During initialization, the Flask app: • Reads artist data with features normalized for clustering • Applies the K-Means model to assign cluster labels • Builds an efficient lookup structure for O(1) cluster-based retrieval **Tech Stack:** Built with **Python** and **Flask** for the backend, **Pandas** for data manipulation, **Matplotlib** for cluster visualization, and **Spotipy** for Spotify API integration. The frontend uses vanilla JavaScript with AJAX for asynchronous track preview loading.

Problem
Listeners need a simple way to explore artists by musical similarity rather than popularity alone.
My role
Built the clustering workflow, Flask service, artist lookup, Spotify integration, and asynchronous web experience.
Approach
Cluster normalized artist features with K-Means and enrich same-cluster recommendations with Spotify metadata and track previews.
Outcome
Delivered an interactive recommendation prototype and clustering visualization; no user-adoption metric is claimed.
Implementation
- Clustered artist feature vectors with K-Means.
- Built constant-time cluster lookup in a Flask application.
- Fetched Spotify previews, related artists, and metadata with Spotipy.
Evaluation
- Visualized cluster structure and compared recommendations with Spotify related artists.
- No offline relevance benchmark is documented.
Results
- Produced a working artist-discovery application with playable previews.
- The project is presented as an unsupervised recommendation study.
Constraints
- Similarity had to be inferred without labeled recommendation pairs.
- Spotify metadata and previews depended on an external API.
- Artist features needed normalization before distance-based clustering.
Tradeoffs
- K-Means is simple and explainable but assumes roughly spherical clusters.
- External API availability limits which previews can be shown.
Next improvements
- Add listener feedback and evaluate recommendation relevance.
- Compare density-based, graph, and embedding-driven recommendation methods.