Audio Feature-Based Musical Mode Classification Using Machine Learning Techniques

Authors

  • Hira Farman Department of Computer Science, Iqra University, Karachi, Sindh, Pakistan
  • Saif Hassan Department of Computer Science, Sukkur IBA University, Sindh, Pakistan
  • Khurshed Ali Sukkur IBA University
  • Muhammad Ismail Mangrio Department of Computer Science, Sukkur IBA University, Sindh, Pakistan
  • Danish Ali Raza Department of Computer Science, Iqra University, Karachi, Sindh, Pakistan
  • Muhammad Makki Department of Computer Science, Iqra University, Karachi, Sindh, Pakistan

Keywords:

Music Data Analysis, Spotify, Musical Mode Classification , Audio Feature Analytics , Song Popularity Prediction

Abstract

Spotify’s rapid growth has transformed the music industry, shifting consumption from physical and downloaded sales toward streaming on data-driven platforms. The resulting volume of audio and streaming data creates new opportunities to understand music structure, listener behavior, and song properties through machine learning and music analytics. This paper proposes a supervised machine learning framework for classifying the musical mode (Major or Minor) of songs on Spotify using both acoustic and streaming-related features. The dataset, obtained from Kaggle, contains 953 songs described by attributes including BPM, danceability, energy, valence, acousticness, instrumentalness, liveness, speechiness, playlist appearances, and streaming statistics. Five classification algorithms were implemented and compared: Logistic Regression, Random Forest, Decision Tree, K-Nearest Neighbors, and Naïve Bayes. Model performance was assessed using accuracy, precision, recall, F1-score, Matthews correlation coefficient, area under the curve, and confusion matrix analysis. The Random Forest classifier achieved the highest predictive accuracy (98.3%), F1-score (98.2%), MCC (0.964), and AUC (0.999), showing the strongest discrimination between Major and Minor modes. Decision Tree achieved comparatively strong results, while Logistic Regression and Naïve Bayes performed less effectively due to the high correlation and nonlinearity among Spotify’s audio features. Danceability, energy, valence, BPM, and acousticness emerged as the most influential features for distinguishing emotional and tonal song structure. The proposed framework demonstrates the value of machine learning for music analytics and offers practical insights for recommendation systems, playlist optimization, artist strategy, and streaming platform intelligence, contributing a reproducible, data-driven approach to musical mode classification.

Downloads

Published

2026-09-30