This project applies Unsupervised Machine Learning techniques to cluster Amazon Music songs based on their audio characteristics. The objective is to automatically group similar songs based on their audio features, making it easier to build music recommendation systems, generate playlists, and improve music discovery.
The project includes:
- Data Exploration and Preprocessing
- Exploratory Data Analysis (EDA)
- Feature Scaling using StandardScaler
- K-Means Clustering
- Elbow Method for Optimal Cluster Selection
- Silhouette Score Evaluation
- PCA Visualization
- Cluster Interpretation
- Streamlit Dashboard
- Model Serialization using Pickle
Music streaming platforms contain thousands of songs with varying audio characteristics. Manually organizing songs based on their musical properties is inefficient and time-consuming.
The objective of this project is to automatically group songs with similar audio characteristics using clustering techniques, enabling playlist generation, personalized recommendations, and music discovery.
Dataset: single_genre_artists.csv
| Feature | Description |
|---|---|
| danceability | Suitability of a track for dancing |
| energy | Intensity and activity level |
| loudness | Overall loudness of the song |
| speechiness | Presence of spoken words |
| acousticness | Acoustic nature of the track |
| instrumentalness | Probability of containing no vocals |
| liveness | Presence of audience/live recording |
| valence | Musical positivity |
| tempo | Beats per minute |
| duration_ms | Song duration in milliseconds |
- name_song
- name_artists
- genres
These columns are used only for displaying song information and interpreting clusters.
- Python
- Pandas
- NumPy
- Matplotlib
- Seaborn
- Plotly
- Scikit-Learn
- Streamlit
- Pickle
- Load the dataset into Pandas DataFrame.
- Understand dataset dimensions.
- Check column names and data types.
- Check missing values.
- Check duplicate records.
- Remove unnecessary columns.
- Select relevant numerical features.
- Summary statistics
- Distribution plots
- Correlation Heatmap
Apply StandardScaler to standardize feature values.
Reason:
- K-Means is distance-based.
- Features should have equal importance.
Two evaluation techniques were used:
- Calculates Inertia for different K values.
- Helps identify the optimal number of clusters.
- Measures cluster quality.
- Higher score indicates better clustering.
- Train K-Means model.
- Assign cluster labels.
- Add cluster labels to the original dataset.
Reduce high-dimensional data into two principal components for visualization.
Analyze average feature values of each cluster to understand song characteristics.
Using Pickle:
- scaler.pkl
- kmeans_model.pkl
- pca.pkl
Interactive dashboard providing:
- Song Search
- Cluster Filtering
- PCA Visualization
- Cluster Distribution
- Cluster Statistics
Measures how similar a song is to its own cluster compared to other clusters.
Interpretation:
- Close to 1 β Excellent clustering
- Close to 0 β Overlapping clusters
- Less than 0 β Poor clustering
Measures cluster compactness and separation.
Lower value indicates better clustering.
Measures cluster compactness.
Used to determine the optimal K using the Elbow Method.
AMAZON MUSIC CLUSTERING PROJECT/
β
βββ Report/
β βββ Amazon Music Song Clustering Report.pdf
β
βββ Screenshots/
β βββ Home Page.png
β βββ PCA Visualization.png
β βββ Cluster Analysis.png
β βββ Cluster Explorer.png
β
βββ app.py
βββ genre_artists analysis.ipynb
βββ README.md
βββ requirements.txt
βββ scaler.pkl
βββ kmeans_model.pkl
βββ pca.pkl
βββ songs_clustered.csv
βββ single_genre_artists.csv
The songs_clustered.csv dataset is not included in this repository due to its large size.
git clone <repository-url>pip install -r requirements.txtjupyter notebookOpen:
genre_artists analysis.ipynb
streamlit run app.py- Music Recommendation Systems
- Playlist Generation
- Song Similarity Analysis
- Audio Feature Analysis
- User Preference Analysis
- Music Discovery
- Content Personalization
- Implement DBSCAN Clustering
- Hierarchical Clustering
- Personalized Recommendation Engine
- Cloud Deployment
- Real-Time Audio Analysis
- Deep Learning-Based Song Embeddings
- Unsupervised Machine Learning
- K-Means Clustering
- Principal Component Analysis (PCA)
- Feature Scaling using StandardScaler
- Cluster Evaluation Techniques
- Data Visualization
- Model Serialization using Pickle
- Streamlit Dashboard Development



