For millions of Spotify users, Mondays mean new music. The app was launched 10 years ago, on October 7, 2008, to allow listeners to stream their favorite songs. Normally, users choose their own music. The Discover Weekly playlist, however, offers something totally unexpected. The playlist is packed with artists that listeners have probably never heard of but whose music perfectly matches their tastes.
To some listeners, the playlists can be almost eerily perfect. The feature was added in 2015 and has been carefully crafting playlists ever since. But there’s no dark magic behind the recommendations—it’s all data analysis, probability, and computer science.
Ed Newett is a computer scientist at Spotify. He created the Discover Weekly algorithm, which assembles those perfect playlists. An algorithm is a set of rules that a computer follows to solve a problem. It takes inputs, or provided information, and creates outputs, or results, based on the algorithm’s rules.
Discover Weekly’s algorithm consists of two steps. “The first step is learning how songs are related to one another,” explains Newett. It learns this by studying the playlists that users have already created. The more frequently songs appear together on user-created playlists, the stronger the relationship between the songs, and the stronger the likelihood that someone who likes one song will like the other. Spotify’s Discover Weekly algorithm has a staggering amount of data to learn from: 35 million songs found in more than 2 billion user-created playlists!