Upload README.md
Browse files
README.md
CHANGED
|
@@ -7,29 +7,19 @@
|
|
| 7 |
|
| 8 |
This repository contains a comprehensive exploratory data analysis (EDA) on a music features dataset. The primary objective is to understand the patterns in audio features and analyze how they relate to user preferences, providing insights for music recommendation systems and user profiling.
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
## π Dataset Overview
|
| 25 |
-
|
| 26 |
-
The dataset (`train.csv`) contains audio features extracted from music tracks along with user preference scores. This rich collection of acoustic and musical attributes enables deep analysis of what makes music appealing to listeners.
|
| 27 |
-
|
| 28 |
-
**Dataset Statistics:**
|
| 29 |
-
- **Total Records:** [Insert actual count]
|
| 30 |
-
- **Features:** 13 audio features + 1 target variable
|
| 31 |
-
- **File Size:** [Insert size]
|
| 32 |
-
- **Format:** CSV
|
| 33 |
|
| 34 |
## πΌ Features Description
|
| 35 |
|
|
@@ -51,18 +41,53 @@ The dataset (`train.csv`) contains audio features extracted from music tracks al
|
|
| 51 |
| `liked` | **Target Variable:** User preference score | Float | Continuous values |
|
| 52 |
|
| 53 |
|
| 54 |
-
### Setup Instructions
|
| 55 |
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
-
2. **Install dependencies:**
|
| 63 |
-
```bash
|
| 64 |
-
pip install -r requirements.txt
|
| 65 |
-
```
|
| 66 |
|
| 67 |
### Required Libraries
|
| 68 |
```txt
|
|
@@ -99,11 +124,6 @@ Our comprehensive preprocessing pipeline includes:
|
|
| 99 |
|
| 100 |
## π Analysis & Visualizations
|
| 101 |
|
| 102 |
-
### Generated Visualizations
|
| 103 |
-
|
| 104 |
-
### Total_Liked_and_Disliked_Songs
|
| 105 |
-
|
| 106 |
-

|
| 107 |
|
| 108 |
### Pairplot_features_liked
|
| 109 |
|
|
@@ -125,12 +145,6 @@ Our comprehensive preprocessing pipeline includes:
|
|
| 125 |
|
| 126 |

|
| 127 |
|
| 128 |
-
### Key Analytical Approaches
|
| 129 |
-
|
| 130 |
-
1. **Univariate Analysis:** Individual feature distributions and statistics
|
| 131 |
-
2. **Bivariate Analysis:** Pairwise relationships and correlations
|
| 132 |
-
3. **Multivariate Analysis:** Complex feature interactions
|
| 133 |
-
4. **Outlier Analysis:** Identification of anomalous data points
|
| 134 |
|
| 135 |
## π Key Findings
|
| 136 |
|
|
@@ -159,47 +173,6 @@ Our comprehensive preprocessing pipeline includes:
|
|
| 159 |
- **Least predictive feature:** Key/Mode
|
| 160 |
- **Data quality:** [X]% complete records after preprocessing
|
| 161 |
|
| 162 |
-
## π Usage
|
| 163 |
-
|
| 164 |
-
### Quick Start
|
| 165 |
-
|
| 166 |
-
1. **Load and explore the data:**
|
| 167 |
-
```python
|
| 168 |
-
import pandas as pd
|
| 169 |
-
from src.data_preprocessing import load_and_clean_data
|
| 170 |
-
|
| 171 |
-
# Load the dataset
|
| 172 |
-
df = load_and_clean_data('data.csv')
|
| 173 |
-
print(df.info())
|
| 174 |
-
```
|
| 175 |
-
|
| 176 |
-
2. **Generate visualizations:**
|
| 177 |
-
```python
|
| 178 |
-
from src.visualization import create_correlation_heatmap, plot_distributions
|
| 179 |
-
|
| 180 |
-
# Create correlation heatmap
|
| 181 |
-
create_correlation_heatmap(df)
|
| 182 |
-
|
| 183 |
-
# Plot feature distributions
|
| 184 |
-
plot_distributions(df)
|
| 185 |
-
```
|
| 186 |
-
|
| 187 |
-
3. **Run complete analysis:**
|
| 188 |
-
```bash
|
| 189 |
-
python src/analysis.py
|
| 190 |
-
```
|
| 191 |
-
|
| 192 |
-
### Jupyter Notebook Workflow
|
| 193 |
-
|
| 194 |
-
```bash
|
| 195 |
-
# Start Jupyter Lab
|
| 196 |
-
jupyter lab
|
| 197 |
-
|
| 198 |
-
# Open notebooks in order:
|
| 199 |
-
# 1. notebooks/01_data_exploration.ipynb
|
| 200 |
-
# 2. notebooks/02_preprocessing.ipynb
|
| 201 |
-
# 3. notebooks/03_analysis.ipynb
|
| 202 |
-
```
|
| 203 |
|
| 204 |
## π Results
|
| 205 |
|
|
@@ -208,11 +181,6 @@ jupyter lab
|
|
| 208 |
- Optimal feature ranges for high user satisfaction identified
|
| 209 |
- Recommendations for music recommendation system development
|
| 210 |
|
| 211 |
-
### Business Applications
|
| 212 |
-
1. **Music Recommendation Systems:** Use correlation insights for better suggestions
|
| 213 |
-
2. **Playlist Generation:** Apply valence and energy patterns for mood-based playlists
|
| 214 |
-
3. **A/B Testing:** Test hypothesis about feature importance in user engagement
|
| 215 |
-
4. **Content Curation:** Focus on high-correlation features for content selection
|
| 216 |
|
| 217 |
## π Technologies Used
|
| 218 |
|
|
|
|
| 7 |
|
| 8 |
This repository contains a comprehensive exploratory data analysis (EDA) on a music features dataset. The primary objective is to understand the patterns in audio features and analyze how they relate to user preferences, providing insights for music recommendation systems and user profiling.
|
| 9 |
|
| 10 |
+
|
| 11 |
+
## π₯ Dataset Overview
|
| 12 |
+
|
| 13 |
+
The dataset (`data.csv`) contains audio features extracted from music tracks along with user preference scores. This rich collection of acoustic and musical attributes enables deep analysis of what makes music appealing to listeners.
|
| 14 |
+
|
| 15 |
+
**Total songs:** 195
|
| 16 |
+
**Format:** CSV (data.csv)
|
| 17 |
+
**Source:** Spotify API
|
| 18 |
+
**Target column:** liked (1 = liked, 0 = disliked)
|
| 19 |
+
**Data type:** Tabular
|
| 20 |
+
**Licensing:** For academic and personal research use (derived from Spotify API)
|
| 21 |
+
|
| 22 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
## πΌ Features Description
|
| 25 |
|
|
|
|
| 41 |
| `liked` | **Target Variable:** User preference score | Float | Continuous values |
|
| 42 |
|
| 43 |
|
|
|
|
| 44 |
|
| 45 |
+
### π EDA Overview: Music Preference Dataset
|
| 46 |
+
|
| 47 |
+
## 1οΈβ£ Null Values Check
|
| 48 |
+
β The dataset is complete β no missing entries detected.
|
| 49 |
+
|
| 50 |
+
## 2οΈβ£ Target Class Breakdown
|
| 51 |
+
|
| 52 |
+
Liked Tracks (1): 100 entries
|
| 53 |
+
|
| 54 |
+
Disliked Tracks (0): 95 entries
|
| 55 |
+
|
| 56 |
+
### Total_Liked_and_Disliked_Songs
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
|
| 60 |
+
## π’ The class distribution is fairly even β no need for balancing.
|
| 61 |
+
|
| 62 |
+
## 3οΈβ£ Feature Types
|
| 63 |
+
|
| 64 |
+
All input variables are numeric.
|
| 65 |
+
|
| 66 |
+
The target label liked is a binary flag (0 = dislike, 1 = like).
|
| 67 |
+
|
| 68 |
+
## 4οΈβ£ Key Statistical Insights
|
| 69 |
+
|
| 70 |
+
Higher average values for energy, danceability, and valence are seen in liked songs.
|
| 71 |
+
|
| 72 |
+
In contrast, acousticness and instrumentalness are more prominent in disliked tracks.
|
| 73 |
+
|
| 74 |
+
## 5οΈβ£ Correlation Patterns
|
| 75 |
+
|
| 76 |
+
π Positive: energy strongly correlates with loudness.
|
| 77 |
+
|
| 78 |
+
π» Negative: acousticness shows inverse correlation with energy and valence.
|
| 79 |
+
|
| 80 |
+
## 6οΈβ£ Recommended Visual Explorations
|
| 81 |
+
π Try the following plots to gain deeper insights:
|
| 82 |
+
|
| 83 |
+
π¦ Boxplots comparing liked vs energy, danceability
|
| 84 |
+
|
| 85 |
+
π Bar chart for distribution of likes/dislikes
|
| 86 |
+
|
| 87 |
+
π‘οΈ Heatmap of all feature correlations
|
| 88 |
+
|
| 89 |
+
π― Scatter plot: energy vs valence, with points colored by liked status
|
| 90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
### Required Libraries
|
| 93 |
```txt
|
|
|
|
| 124 |
|
| 125 |
## π Analysis & Visualizations
|
| 126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
|
| 128 |
### Pairplot_features_liked
|
| 129 |
|
|
|
|
| 145 |
|
| 146 |

|
| 147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
|
| 149 |
## π Key Findings
|
| 150 |
|
|
|
|
| 173 |
- **Least predictive feature:** Key/Mode
|
| 174 |
- **Data quality:** [X]% complete records after preprocessing
|
| 175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
|
| 177 |
## π Results
|
| 178 |
|
|
|
|
| 181 |
- Optimal feature ranges for high user satisfaction identified
|
| 182 |
- Recommendations for music recommendation system development
|
| 183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
|
| 185 |
## π Technologies Used
|
| 186 |
|