Predict the popularity of a music genre from Spotify data

Is it possible to predict the popularity of a music genre based on historical data?


In this brief essay I will use some regression methods in R to understand if it is possible to predict the popularity of a music genre base on some empirical features and historical data.


  1. Popularity does not depend on the historical moment
  2. Popularity isn’t influenced by ither industry functions, as the distribution, marketing etc.
  3. Popularity can be summarized as a linear function of the others attributes, linear assumpion.
Features of the genres divided by High or Low popularity.
Multi dimensional plot to read the data and the correlations.

Check the outliers

The first think to do is to take a look to the data and try to understand some particular patterns and the outliers that we don’t need for the analysis. In this case I delated the very unpopular genres with some variables equal to 0.

Stay Hungry, stay simple

We always build up very complex methods to solve our data science problems, sometimes it is useful to beging from the simplest methods, these could be very useful and fast.

Linear Regressions

I report only the results of the analysis.

Linear models doesn’t mean linear dependence!

Depende of the popularity against the loudness.
Comparison between the Real popularity (x-axis) and the predicted popularity (y-axis).


I will write a post to better investigate the methods used in this brief report.

  1. Make easy plots: plot the data is an art, train it and you will succeed.
  2. Use simple methods: Start using simple methods and add complexity to the model step by step.
  3. Reach an end: before starting make some questions, and if you answered them you finished your work. Don’t try to obtain something impossible to reach.
  4. Useful results: once you end your project check if your results are useful, this is extremely important!

Data Science student and start-up enthusiastic. I write about data science, artificial intelligence and everyday lifestyle. Enjoy!