Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fabriciocarraro/spotify-song-recommender-using-clustering
https://github.com/fabriciocarraro/spotify-song-recommender-using-clustering
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/fabriciocarraro/spotify-song-recommender-using-clustering
- Owner: fabriciocarraro
- Created: 2024-03-23T18:31:02.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-08-28T23:21:51.000Z (4 months ago)
- Last Synced: 2024-08-30T00:18:01.208Z (4 months ago)
- Language: Jupyter Notebook
- Size: 6.63 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spotify Song Recommender
This project analyzes Spotify music data to explore trends, correlations, and create a simple song recommendation system using machine learning techniques.
## Table of Contents
- [Overview](#overview)
- [Features](#features)
- [Requirements](#requirements)
- [Usage](#usage)
- [Analysis Highlights](#analysis-highlights)
- [Recommendation System](#recommendation-system)## Overview
This project uses Spotify music data to perform various analyses and build a recommendation system. It explores trends in music features over time, correlations between different audio features, and uses machine learning techniques to cluster similar songs.
## Features
- Data preprocessing and cleaning
- Trend analysis of audio features over time
- Correlation analysis between different audio features
- Genre clustering using PCA and K-means
- Song recommendation system based on audio features## Requirements
- Python 3.x
- pandas
- numpy
- plotly
- scikit-learn
- IPython (for notebook display)## Usage
1. Ensure you have the required CSV files:
- `Dados_totais.csv`
- `data_by_genres.csv`
- `data_by_year.csv`2. Run the Jupyter notebook or Python script to perform the analysis.
3. Follow the code comments for detailed explanations of each step.
## Analysis Highlights
1. **Loudness Trend**: The project analyzes the variation of loudness in music over the years.
2. **Audio Feature Trends**: Visualizes trends for multiple audio features (acousticness, valence, danceability, energy, instrumentalness, liveness, speechiness) from 2000 onwards.
3. **Feature Correlation**: A heatmap is generated to show correlations between different audio features.
4. **Genre Clustering**: Using PCA and K-means, the project clusters music genres based on their audio features.
5. **Song Clustering**: Similar to genre clustering, individual songs are clustered based on their features and artist information.
## Recommendation System
The project includes a simple recommendation system that suggests similar songs based on audio features. It uses the following steps:
1. Dimensionality reduction using PCA
2. K-means clustering on the reduced feature space
3. Euclidean distance calculation to find the nearest neighbors within a clusterTo get recommendations, use the `recomendador` function with a song name as input.
Example:
```python
recomendador('Foo Fighters - Best of You')
```This will return a list of 20 recommended songs based on similarity to the input song.
---
Feel free to contribute to this project by opening issues or submitting pull requests!