The Recommendation Algorithm
NextTrack uses a hybrid recommendation system that combines content-based filtering
with external data enrichment. Here's exactly how it works:
Step 1: Vector Space Model
Each track is represented as a 5-dimensional feature vector:
- Energy (0-1) - Intensity and activity level
- Valence (0-1) - Musical positiveness/mood
- Danceability (0-1) - Rhythm and beat strength
- Acousticness (0-1) - Acoustic vs electronic sound
- Tempo (BPM/200) - Normalized beats per minute
Your playlist's centroid (average vector) represents your taste profile.
We rank candidates by Euclidean distance - tracks closest to your centroid score highest.
Step 2: External Data Enhancements
After initial scoring, we apply multiplicative boosts based on artist relationships:
- Similar Artists (+20%) - From Last.fm's collaborative filtering. If fans of your playlist artists also like Artist X, tracks by X get boosted.
- Influence Chain (+15%) - From Wikidata P737 property. If The Beatles influenced your playlist, tracks by Elvis, Buddy Holly, Chuck Berry get boosted.
- Tag Matching (+8%) - From Last.fm community tags. Matching genre/mood tags (e.g., "british invasion", "psychedelic") provide smaller boosts.
Step 3: Preference Learning
Your like/dislike feedback trains categorical preferences. The system learns which
countries, decades, artist types (solo/group), and genres you prefer - then adjusts future
recommendation scores accordingly. This learning persists across your session.
Step 4: Optional Filters
Apply hard filters powered by MusicBrainz metadata: Country (artist origin),
Decade (formation year), Artist Type (solo artist vs group).
Filters exclude non-matching tracks entirely.