All projects
Dec 2024

ML for Genre Clustering and Popularity Forecasting from Spotify Charts

Using Spotify's Top 200 chart data, this project grouped songs by their audio profile, predicted which songs become hits, and forecast which artists would dominate the charts in 2024, comparing classic time-series models with gradient-boosting methods.

PythonMLXGBoostARIMAProphetLightGBM

7,700+

songs clustered by audio features

0.89

F1-score for hit prediction

4

forecasting models compared

Pipeline

01

Data

Spotify Top 200 chart history with audio features for each song

02

Features

Preprocessing, feature engineering and PCA

03

Cluster

K-Means and GMM group songs by audio profile

04

Classify

Random forest, decision tree and logistic regression predict hits

05

Forecast

ARIMA, Prophet, XGBoost and LightGBM predict 2024's top artists

Clustering songs

Audio features such as danceability, energy, acousticness and valence were reduced with PCA and clustered, producing groups with clear musical identities, for example high-danceability, high-energy tracks versus low-energy acoustic ones.

Predicting hits

Engineered features fed several classifiers to predict hit songs and popular artists, evaluated with accuracy, precision, recall and F1-score using five-fold cross-validation. The best model reached an F1-score of 0.89.

Forecasting 2024

Each artist's chart points over time were treated as a time series. ARIMA and Prophet were compared with per-artist XGBoost and LightGBM regressors, both on daily points and on monthly appearances, to forecast the most popular artists of 2024.

Scatter plot of songs in two PCA dimensions, coloured by six clusters
Songs projected onto two principal components and grouped into six clusters by audio profile.
Bar chart of the top 20 artists predicted for 2024 by ARIMA, led by The Weeknd
ARIMA forecast of the top 20 artists for 2024, ranked by total predicted chart points.