{"id":22712363,"url":"https://github.com/pavankethavath/music_recommendation_engine","last_synced_at":"2026-05-17T00:06:01.254Z","repository":{"id":264684548,"uuid":"881527934","full_name":"pavankethavath/Music_Recommendation_Engine","owner":"pavankethavath","description":"An advanced Music Recommendation System leveraging a Spotify dataset to deliver personalized song suggestions. The project applies KMeans clustering, PCA, t-SNE, and cosine similarity for precise recommendations. Built with a user-friendly Streamlit interface, it showcases data preprocessing, unsupervised learning, and insightful visualizations.","archived":false,"fork":false,"pushed_at":"2024-11-27T16:39:20.000Z","size":40441,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T22:25:10.976Z","etag":null,"topics":["clustering","elbow-method","feature-extraction","kmeans-clustering","pca","recommendation-system","spotify","streamlit","tsne"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pavankethavath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-31T18:50:37.000Z","updated_at":"2024-11-27T16:40:24.000Z","dependencies_parsed_at":"2025-02-04T23:40:09.155Z","dependency_job_id":null,"html_url":"https://github.com/pavankethavath/Music_Recommendation_Engine","commit_stats":null,"previous_names":["pavankethavath/music_recommendation_engine"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pavankethavath/Music_Recommendation_Engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavankethavath%2FMusic_Recommendation_Engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavankethavath%2FMusic_Recommendation_Engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavankethavath%2FMusic_Recommendation_Engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavankethavath%2FMusic_Recommendation_Engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pavankethavath","download_url":"https://codeload.github.com/pavankethavath/Music_Recommendation_Engine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavankethavath%2FMusic_Recommendation_Engine/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263140793,"owners_count":23419954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clustering","elbow-method","feature-extraction","kmeans-clustering","pca","recommendation-system","spotify","streamlit","tsne"],"created_at":"2024-12-10T13:11:03.501Z","updated_at":"2025-10-11T22:16:07.417Z","avatar_url":"https://github.com/pavankethavath.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎵 **Music Recommendation System**\n\nAn advanced **Music Recommendation System** powered by data science and a comprehensive **Spotify dataset**. This project leverages real-world song data, unsupervised learning, and similarity metrics to deliver personalized music recommendations.\n\n![Streamlit Interface](./images/home.png)\n---\n## 🌟 Overview\n\nThis project demonstrates the application of data science to solve real-world problems in the music industry. By preprocessing, clustering, and analyzing song data, the system provides recommendations for users based on the similarity of features like danceability, energy, and tempo. \n\n---\n\n## 🌟 **Project Highlights**\n\n- **Real Data**: The dataset includes detailed song-level attributes sourced from Spotify, providing insights into audio characteristics.\n- **Unsupervised Learning**: Implements **KMeans Clustering** for grouping similar songs.\n- **Similarity-Based Recommendations**: Uses **cosine similarity** to recommend songs closest to user preferences.\n- **Interactive Interface**: A clean and user-friendly **Streamlit** web application for seamless user interaction.\n- **Data Visualization**: Insightful visualizations showcasing clustering, feature correlations, and distributions.\n\n---\n\n## 🚀 **How It Works**\n\n1. **Data Collection**: \n   - The dataset contains song features like `danceability`, `energy`, `tempo`, and more.\n   - Metadata such as song names, artists, popularity, and release year are included for richer insights.\n\n2. **Data Processing**:\n   - Standardized numerical features to ensure uniformity using **StandardScaler**.\n   - Dimensionality reduction using **PCA** for noise reduction and computational efficiency.\n\n3. **Unsupervised Learning**:\n   - **KMeans Clustering** groups songs with similar attributes.\n   - Optimal clusters are determined using the **Elbow Method**.\n     ![PCA Visualization](./images/elbow_method.png)\n\n4. **Recommendation Generation**:\n   - **Cosine Similarity** measures the closeness of songs within a cluster.\n   - Recommendations are ranked by similarity score.\n\n5. **Interactive User Interface**:\n   - Built with **Streamlit** for a dynamic and easy-to-use app.\n   - Users input a song name to get recommendations based on dataset attributes.\n\n---\n\n## 📂 Project Components\n\n- **Data Preprocessing and Clustering**:\n  - File: `Music_Clustering_and_Recommendation.py`\n  - Steps include data cleaning, normalization, clustering, and model saving.\n  \n- **Recommendation Engine**:\n  - File: `recommendation_engine.py`\n  - Implements the recommendation logic with a user-friendly Streamlit interface.\n\n- **Saved Artifacts**:\n  - `preprocessed_data.csv`: Preprocessed music data ready for recommendations.\n  - `kmeans_model.pkl`: Trained KMeans model for clustering.\n\n## 🚀 How to Run the Project\n\n### Prerequisites\n\nEnsure the following are installed:\n- Python 3.8 or higher\n- Libraries: Streamlit, Pandas, Scikit-learn, Matplotlib, Seaborn, Plotly\n\n### Steps\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/your-username/music-recommendation-system.git\n   cd music-recommendation-system\n2. Run the Streamlit app:\n   ```bash\n   streamlit run recommendation_engine.py\n3. Open the URL (usually `http://localhost:8501`) in your browser.\n4. Enter a song name and get data-driven recommendations!\n\n   \n# 📊 Data Features\n\n### **Features in the Spotify Dataset**\n- **Audio Features**:\n  - `Danceability`, `Energy`, `Acousticness`, `Instrumentalness`, `Loudness`, `Speechiness`, `Liveness`, `Valence`, `Tempo`\n- **Popularity**: Reflects the song’s global reach.\n- **Metadata**: Duration (in milliseconds), release year, song name, and artist.\n\n### **Preprocessing**:\n- Standardized numerical features for uniform scaling.\n- Added a `decade` feature for exploratory analysis.\n![PCA Visualization](./images/popularity.png)\n\n---\n\n# 🖼️ Visualizations\n\n### **Clustering Visualization (PCA)**:\nClusters are visualized using **Principal Component Analysis (PCA)**, showing clear separations among song groups. Here's an example of the clustering output:\n\n![PCA Visualization](./images/pca.png)\n### **Clustering Visualization (t-SNE)**:\nTo further understand cluster separations, we used **t-SNE** for high-dimensional data visualization:\n\n![t-SNE Visualization](./images/t-sne.png)\n\n### **Streamlit Interface**:\nA snapshot of the interactive Streamlit interface where users can input a song name and view recommendations:\n\n![Streamlit Interface](./images/streamlit_app.png)\n\n### **Feature Correlations**:\nA **correlation heatmap** highlights the relationships between features, enabling effective feature selection:\n\n![Feature Correlations](./feature_correlation.png)\n\n---\n\n# 🤖 Data Science Techniques\n\n### **Dimensionality Reduction**:\n- PCA and t-SNE for reducing noise and improving cluster interpretability.\n\n### **Unsupervised Learning**:\n- KMeans for clustering songs based on similar features.\n\n### **Similarity Metrics**:\n- Cosine similarity for ranking song recommendations.\n\n### **Model Evaluation**:\n- **Silhouette Scores** and **Elbow Method** for validating clustering performance.\n\n---\n\n# 🔍 Key Insights\n\n- **Data-Driven Approach**: Demonstrates the application of unsupervised learning for personalized recommendation systems.\n- **Effective Clustering**: Clustering simplifies the recommendation process by narrowing down candidates.\n- **Scalability**: Ready for integration with large-scale datasets or additional features.\n- **Interactive Visualizations**: Improves transparency and interpretability of the model’s results.\n\n---\n\n# 🎯 Future Enhancements\n\n### **Real-Time Data Integration**:\n- Add more metadata or integrate with live Spotify API data in the future.\n\n### **Advanced Models**:\n- Explore deep learning techniques such as Autoencoders for feature extraction.\n\n### **Enhanced Clustering**:\n- Experiment with algorithms like DBSCAN or Hierarchical Clustering for better performance on sparse datasets.\n\n---\n\n# 💡 Contributions\n\nData enthusiasts and developers are welcome! Feel free to fork the repository and submit pull requests to enhance the project.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavankethavath%2Fmusic_recommendation_engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpavankethavath%2Fmusic_recommendation_engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavankethavath%2Fmusic_recommendation_engine/lists"}