# Assignment #1 - EDA & Dataset - orian rivlin **Goal:** Explore which audio features are most strongly related to a track’s popularity on Spotify. This repository includes the dataset sample, a well-documented notebook, saved figures, and a short video walkthrough. --- ## Dataset - **Name:** Spotify Features (Sample) - **File:** `SpotifyFeatures_sample.csv` - **Rows:** ~10,000  |  **Columns:** 18 (mostly numeric) - **Target:** `popularity` (0–100) - **Main numeric features:** `danceability`, `energy`, `loudness`, `speechiness`, `acousticness`, `instrumentalness`, `liveness`, `valence`, `tempo`, `duration_ms` - **Source:** Spotify Tracks DB (via Kaggle) **Main question:** Which audio features are most strongly related to popularity? --- ## Data Cleaning (Step 2.1) - Removed duplicate rows. - Checked missing values (none in key columns) - Dropped rows with NA in core numeric features if present. - Built a numeric-only DataFrame for stats and correlations. Result: 10,000 rows × 11 numeric features** ready for EDA. --- ## EDA Highlights ### 1) Distributions - **Popularity** is concentrated around 40-60 with few very high hits (80+). - **Danceability** ~ bell-shaped around ~0.56. - **Energy** skews higher (many tracks at 0.7-0.9). - **Valence** is broadly spread (neutral on average). ![Popularity distribution](materials/popularity_hist.png) ![Feature distributions](materials/features_dists.png) ### 2) Correlations with Popularity Top relationships: | Feature | Corr. with popularity | |------------------|-----------------------| | **loudness** | **+0.31** | | **energy** | **+0.27** | | danceability | +0.06 | | tempo | +0.02 | | valence | −0.06 | | **acousticness** | **−0.35** | **Interpretation.** Popular tracks tend to be louder and more energetic, and less acoustic. ![Correlation heatmap](materials/corr_heatmap.png) ### 3) Popular vs. Unpopular (Top 10% vs Bottom 10%) - **Energy** and (slightly) **danceability** are higher among top-10% tracks. - **Tempo** shows little difference. - **Valence** is only slightly higher for top tracks. ![Top vs Bottom 10%](materials/top_vs_bottom_boxplot.png) --- ## Key Insights - Popularity on Spotify is uneven: only a small minority of tracks become very popular. - Loudness and energy are the strongest positive correlates of popularity; acousticness is the strongest negative correlate. - Highly popular songs tend to sound modern/produced (loud, energetic), while purely acoustic/instrumental tracks underperform on average. --- ## Prestation Video **Video:** (https://youtu.be/CIxhSgZXnyw) --- ## Files - `SpotifyFeatures_sample.csv` – dataset sample - `spotify_eda_notebook.ipynb` – code & plots - `materials/` – exported materials used in this README - `README.md` – this summary --- ## Notes and Decisions - **Outliers** (very long tracks; very low/high popularity) were kept as real observations; statistics were interpreted cautiously. - Correlations are modest overall (music success is multifactorial); results describe associations, not causation.