Presentation is loading. Please wait.

Presentation is loading. Please wait.

Spotify 2.0: Music Recommendation System

Similar presentations


Presentation on theme: "Spotify 2.0: Music Recommendation System"— Presentation transcript:

1 Spotify 2.0: Music Recommendation System
Eddie Galloway, Matthew Hivner, DeVante Pickering *Disclaimer: We don’t actually work for Spotify

2 Goal Informally: The goal of this project is: given a seed song, generate a playlist of length n that minimizes the average difference value between each song. How? Implementation of the Hidden Markov Model Implement Fisher-Yates and Random Shuffle for baseline comparison.

3 Formal Problem Statement
Generate a playlist so that: Where c = the characteristic vector of a song i and n = the number of songs in the playlist.

4 Determining Characteristic Vector
For each song x in song pool. Compute the characteristic vector, c, of song x. Spotify API gives us song characteristics: Danceability (float) - Danceability describes how suitable a track is for dancing based on a combination of musical elements including tempo, rhythm stability, beat strength, and overall regularity. A value of 0.0 is least danceable and 1.0 is most danceable. Loudness (float) - The overall loudness of a track in decibels (dB). Mode (int) - The modality (major or minor) of a track, the type of scale from which its melodic content is derived. Major is represented by 1 and minor is 0. Speechiness (float) - Speechiness detects the presence of spoken words in a track. Acousticness (float) - A confidence measure from 0.0 to 1.0 of whether the track is acoustic represents high confidence the track is acoustic.

5 Determining Characteristic Vector (cont’d)
Instrumentalness (float) - Predicts whether a track contains no vocals. “Ooh” and “Aah” sounds are treated as instrumental in this context. Rap or spoken word tracks are clearly “vocal”. If the instrumentalness value is closer to 1.0, then the greater the likelihood the track contains no vocal content. Tempo (float) - The overall estimated tempo of a track in beats per minute (BPM). These characteristics are used as the hidden values in the HMM model.

6 Hidden Markov Model (HMM)
Implementation of the HMM is as follows: Q : [q1,q2,q3,...qN] = a list of N states. A = a01, a02, … an1, an2, … anm = a transition probability matrix A, with each ai,j representing the probability of moving from state i to j. Q0, QF = special start and end states that are not associated with observations. Complexity: O(nm2)

7 HMM Cont’d

8 Constructing a Probability Matrix
Compute the characteristic vector for every song in song pool. Loop through, the song pool comparing each song to each other. Find difference value between songs. Construct 2D Array of difference values.

9 Playlist Generation For a row in the probability matrix:
Loop through row checking difference values, if value is within threshold: get the song and it’s index. Play song. Update row to index of song that was found. Repeat.

10 Fisher Yates Algorithm
Let n := 1. Choose a random k such that 1 ≤ k ≤ N. If k ≠ n, let An := Ak. Let Ak := n. Increase n by one. If n ≤ N, repeat from step 2. Where N = Predefined length of subset of songs to chose. O(N)

11 Fisher-Yates Algorithm

12 Data

13 Conclusion We were successful in minimizing the difference values in the playlist that we generated. Fisher Yates & Random Shuffle were a toss up. Although far more computationally expensive up front, our Hidden Markov Model implementation produced playlists with a much lower average difference value.

14 Extended Studies Publish playlist generator online to receive user feedback. Determine if “more alike” translates to a better playlist.

15 Questions What is the complexity of the Hidden Markov Model?
O(nm2) What is the difference between Fisher-Yates & a regular random shuffle? Fisher-Yates ensures no repeats. What is the complexity of the Fisher-Yates algorithm? O(n)

16 References https://developer.spotify.com/web-api/


Download ppt "Spotify 2.0: Music Recommendation System"

Similar presentations


Ads by Google