Project 1: Music Recommendation System with k-NN

From Algorithm Implementation to Web Deployment

Overview

Build a Spotify-inspired music recommendation engine from scratch, implementing the k-Nearest Neighbors algorithm and deploying it as an interactive web application. This project bridges the gap between academic ML and real-world applications, taking you through the complete pipeline from data exploration to production deployment. You’ll work with actual Spotify audio features to recommend songs based on musical similarity.

Learning Objectives

By completing this project, you will:

  • Implement k-NN from scratch with multiple distance metrics (Euclidean, Cosine)
  • Analyze Spotify’s audio features (energy, valence, danceability) through exploratory data analysis
  • Engineer features and apply scaling techniques to handle multi-scale data
  • Design hybrid distance functions that combine audio features with metadata
  • Evaluate computational complexity and scalability challenges
  • Deploy your ML model as a REST API with a responsive web interface
  • Optimize with caching strategies for production performance

Materials

TipQuick Access

Project Notebook (GitHub) — Complete implementation guide and assignment
Repository — Full codebase with web application
Live Demo (Static UI) — UI preview only (no backend)

ImportantSubmission Requirements
  1. Completed Jupyter notebook exported as PDF
  2. utils/student_adapter.py with your implementations
  3. Working web application demonstration

What You’ll Build

Core Algorithm

You’ll implement k-NN from the ground up, including: - Distance metric calculations (Euclidean and Cosine) - Efficient neighbor search - Feature scaling for fair comparisons - Hybrid distance functions combining multiple signals

Web Application

Your algorithm will power a full-stack music discovery application featuring: - Search for any track in a 600k+ song database - Real-time recommendations based on audio similarity - YouTube integration for music previews - Interactive controls for algorithm parameters - Mobile-responsive design

Data Analysis

Working with real Spotify data, you’ll explore: - 9 audio features extracted by Spotify’s ML models - Feature distributions, correlations, and outliers - The impact of scaling on distance-based algorithms - Trade-offs between different similarity measures

Additional Resources


Next: Project 2: Neural Archaeology →