Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎧 SmartPlaylist AI

SmartPlaylist AI is a machine learning project that clusters music tracks based on their audio features, allowing users to group songs with similar characteristics (like energy, danceability, and acousticness) into distinct playlists.

🌟 Features

  • Audio Feature Analysis: Uses standard Spotify audio metrics to represent songs.
  • ML Clustering: Implements K-Means Clustering to discover natural groupings of music.
  • Optimal Cluster Selection: Utilizes the Elbow Method to determine the most effective number of clusters ($k$).
  • Interactive UI: A user-friendly Gradio interface for real-time cluster prediction.
  • Cloud Deployment: Fully deployed and hosted on Hugging Face Spaces.

🛠️ Tech Stack

  • Language: Python 3.x
  • Machine Learning: scikit-learn (K-Means, StandardScaler)
  • Data Manipulation: pandas, numpy
  • User Interface: gradio
  • Model Persistence: joblib
  • Visualization: matplotlib, seaborn
  • Deployment: huggingface_hub

📊 Dataset

The model is trained on the Spotify Audio Features Dataset from Kaggle, which includes metrics such as:

  • Acousticness: Whether the track sounds acoustic.
  • Danceability: Suitability for dancing.
  • Energy: Perceptual measure of intensity.
  • Loudness: Overall loudness in dB.
  • Valence: Musical positiveness (happy/sad).
  • Tempo: Beats per minute (BPM).

🚀 Getting Started

Prerequisites

  • Python 3.10+
  • A Kaggle account and API token (kaggle.json).

Installation

  1. Clone the repository:

    git clone <your-repo-url>
    cd "SmartPlaylist AI"
  2. Install dependencies:

    pip install -r requirements.txt
  3. Setup Kaggle API: Place your kaggle.json file in ~/.kaggle/ (Linux/Mac) or C:\Users\<User>\.kaggle\ (Windows).

Usage

  1. Download the Data:

    python download_data.py
  2. Train the Model:

    python train_model.py

    This generates model.pkl, scaler.pkl, and an elbow_plot.png.

  3. Run the Application:

    python app.py

    Open the provided local URL in your browser to start predicting clusters!

🌐 Live Demo

The application is deployed on Hugging Face Spaces: 👉 SmartPlaylist AI on Hugging Face

📈 Evaluation

The model is evaluated using the Silhouette Score, measuring how similar a song is to its own cluster compared to other clusters.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages