Dataset Viewer
Auto-converted to Parquet Duplicate
Search is not available for this dataset
danceability
float64
energy
float64
key
int64
loudness
float64
mode
int64
speechiness
float64
acousticness
float64
instrumentalness
float64
liveness
float64
valence
float64
tempo
float64
duration_ms
int64
time_signature
int64
liked
int64
0.803
0.624
7
-6.764
0
0.0477
0.451
0.000734
0.1
0.628
95.968
304,524
4
0
0.762
0.703
10
-7.951
0
0.306
0.206
0
0.0912
0.519
151.329
247,178
4
1
0.261
0.0149
1
-27.528
1
0.0419
0.992
0.897
0.102
0.0382
75.296
286,987
4
0
0.722
0.736
3
-6.994
0
0.0585
0.431
0.000001
0.123
0.582
89.86
208,920
4
1
0.787
0.572
1
-7.516
1
0.222
0.145
0
0.0753
0.647
155.117
179,413
4
1
0.778
0.632
8
-6.415
1
0.125
0.0404
0
0.0912
0.827
140.951
224,029
4
1
0.666
0.589
0
-8.405
0
0.324
0.555
0
0.114
0.776
74.974
146,053
4
1
0.922
0.712
7
-6.024
1
0.171
0.0779
0.00004
0.175
0.904
104.964
161,800
4
1
0.794
0.659
7
-7.063
0
0.0498
0.143
0.00224
0.0944
0.308
112.019
247,460
4
0
0.853
0.668
3
-6.995
1
0.447
0.263
0
0.104
0.745
157.995
165,363
4
1
0.297
0.993
9
-7.173
1
0.118
0.000057
0.77
0.0766
0.178
127.693
182,427
4
0
0.816
0.433
1
-9.19
1
0.241
0.00471
0
0.132
0.676
147.942
225,000
4
1
0.297
0.973
1
-4.505
1
0.151
0.00146
0.918
0.139
0.234
102.757
170,520
4
0
0.564
0.743
6
-5.782
1
0.22
0.584
0
0.101
0.191
168.849
185,667
4
1
0.64
0.957
8
-2.336
1
0.0741
0.0431
0
0.0789
0.692
134.992
178,013
4
1
0.684
0.64
5
-9.906
0
0.0309
0.221
0.0102
0.179
0.777
106.023
234,267
4
0
0.85
0.853
8
-5.65
1
0.123
0.0155
0
0.105
0.734
142.03
136,901
4
1
0.745
0.456
8
-9.482
1
0.0874
0.44
0
0.072
0.124
94.032
314,367
4
0
0.754
0.475
1
-10.889
1
0.154
0.523
0
0.113
0.235
117.006
201,384
4
1
0.797
0.852
8
-5.202
1
0.241
0.0555
0.000025
0.0536
0.48
136.035
102,353
4
1
0.798
0.835
9
-3.832
1
0.202
0.165
0
0.112
0.609
150.04
139,240
4
1
0.438
0.0825
9
-21.686
0
0.0695
0.983
0.0749
0.0461
0.37
106.275
270,000
5
0
0.802
0.549
5
-8.6
0
0.0631
0.268
0.00496
0.0984
0.498
138.984
184,627
4
1
0.6
0.535
4
-12.028
1
0.376
0.274
0
0.0984
0.205
180.036
176,000
3
1
0.729
0.533
9
-10.104
0
0.444
0.747
0.000005
0.0848
0.422
155.999
225,953
4
0
0.867
0.457
1
-7.908
1
0.237
0.0987
0
0.0967
0.193
101.052
210,733
4
1
0.65
0.545
4
-7.712
0
0.0514
0.271
0.000007
0.102
0.113
76.503
240,924
4
1
0.809
0.574
5
-8.546
0
0.385
0.4
0
0.105
0.756
151.974
185,493
4
1
0.749
0.839
6
-4.847
1
0.297
0.0867
0
0.204
0.804
172.068
111,000
4
1
0.657
0.333
8
-13.553
1
0.526
0.0608
0
0.157
0.313
148.168
98,615
4
1
0.689
0.68
7
-6.551
0
0.0774
0.392
0.000001
0.107
0.567
75.445
168,574
4
1
0.668
0.459
6
-12.072
0
0.118
0.0499
0.000001
0.408
0.525
159.021
186,415
4
1
0.291
0.98
1
-5.138
1
0.153
0.00127
0.091
0.102
0.257
79.792
270,920
4
0
0.573
0.581
10
-9.026
0
0.339
0.753
0.000001
0.13
0.351
76.506
169,347
4
1
0.608
0.471
0
-8.664
1
0.0945
0.446
0.000004
0.369
0.682
70.702
165,800
3
0
0.307
0.0515
4
-28.493
0
0.0324
0.708
0.631
0.42
0.154
128.056
125,533
4
0
0.784
0.7
7
-7.649
0
0.108
0.491
0
0.108
0.769
82.028
190,067
4
0
0.448
0.97
1
-4.197
1
0.105
0.000428
0.912
0.376
0.381
119.215
123,880
4
0
0.648
0.751
8
-8.582
1
0.0806
0.0182
0.000401
0.0418
0.863
100.437
244,827
4
0
0.895
0.479
11
-9.071
0
0.273
0.208
0
0.0902
0.719
146.049
134,554
4
1
0.358
0.977
8
-8.179
0
0.0727
0.000082
0.924
0.103
0.449
137.681
194,160
4
0
0.742
0.423
1
-9.795
0
0.108
0.832
0.00001
0.0644
0.712
75.026
194,000
4
1
0.603
0.886
5
-3.777
0
0.0837
0.00045
0
0.26
0.395
126.025
229,933
4
1
0.839
0.629
3
-5.663
0
0.147
0.241
0
0.108
0.724
94.008
207,772
4
1
0.184
0.974
8
-6.237
0
0.106
0.000023
0.886
0.241
0.33
93.771
257,390
3
0
0.373
0.98
1
-5.016
0
0.122
0.000319
0.906
0.105
0.34
97.346
211,947
4
0
0.826
0.76
11
-6.382
0
0.117
0.392
0
0.132
0.813
99.974
216,285
4
0
0.924
0.748
2
-3.645
1
0.188
0.174
0
0.207
0.381
121.063
209,667
4
1
0.267
0.0024
1
-42.261
0
0.0531
0.995
0.897
0.0942
0.267
71.428
397,773
4
0
0.462
0.974
1
-5.82
1
0.0816
0.000029
0.723
0.0751
0.399
107.877
186,576
3
0
0.616
0.534
10
-10.264
0
0.483
0.639
0
0.0844
0.556
170.054
146,480
4
1
0.878
0.622
2
-6.995
1
0.405
0.153
0
0.0917
0.638
84.991
163,765
4
1
0.581
0.85
5
-3.45
0
0.0734
0.185
0.00046
0.149
0.357
152.018
178,809
4
1
0.656
0.381
0
-8.757
0
0.0802
0.653
0
0.116
0.166
84.907
325,556
4
0
0.363
0.994
8
-5.781
1
0.131
0.000037
0.582
0.207
0.139
108.017
247,564
4
0
0.568
0.788
2
-7.654
1
0.069
0.191
0.000176
0.0774
0.328
139.959
219,077
4
1
0.809
0.653
0
-7.178
0
0.306
0.335
0
0.11
0.639
139.981
199,093
4
1
0.757
0.451
2
-11.121
1
0.292
0.0485
0.000002
0.337
0.506
150.035
167,062
4
1
0.364
0.00799
8
-33.09
1
0.0395
0.978
0.894
0.109
0.0674
101.226
216,093
4
0
0.247
0.992
8
-7.766
0
0.0772
0.000029
0.799
0.0808
0.318
142.891
237,093
4
0
0.598
0.673
2
-10.431
1
0.0693
0.0422
0.000068
0.289
0.59
102.035
197,693
4
0
0.826
0.556
5
-8.516
0
0.191
0.684
0
0.119
0.591
150.067
187,006
4
1
0.318
0.0633
6
-23.869
1
0.0507
0.992
0.871
0.0831
0.0384
129.466
199,133
3
0
0.506
0.881
5
-5.491
0
0.108
0.000163
0.00143
0.23
0.556
148.084
187,322
4
1
0.138
0.991
8
-5.661
1
0.175
0.000015
0.831
0.337
0.0718
94.443
244,239
1
0
0.531
0.803
8
-3.929
0
0.339
0.325
0
0.368
0.414
97.51
191,133
5
1
0.791
0.5
1
-9.805
0
0.42
0.603
0
0.0993
0.492
130.027
170,582
4
1
0.68
0.877
5
-10.241
0
0.0353
0.191
0.000656
0.349
0.922
108.674
185,107
4
0
0.752
0.468
0
-9.966
1
0.333
0.805
0
0.136
0.716
82.795
179,253
4
1
0.797
0.654
8
-7.373
1
0.245
0.633
0
0.106
0.64
145.121
172,520
4
1
0.774
0.853
1
-6.933
1
0.246
0.0275
0
0.0876
0.619
123.041
106,000
4
1
0.851
0.686
11
-8.143
1
0.222
0.597
0.000001
0.111
0.752
154.986
195,344
4
1
0.75
0.772
10
-8.706
0
0.157
0.206
0
0.0748
0.561
139.98
224,496
4
1
0.843
0.656
1
-11.184
1
0.0595
0.0466
0.0187
0.169
0.931
121.112
215,653
4
0
0.539
0.487
1
-9.653
1
0.202
0.309
0
0.097
0.375
169.985
186,353
4
0
0.454
0.968
6
-6.289
1
0.0787
0.000017
0.338
0.0472
0.535
103.965
250,262
4
0
0.446
0.977
10
-5.036
0
0.0781
0.000535
0.472
0.105
0.339
172.059
284,400
4
0
0.827
0.804
9
-5.846
1
0.128
0.455
0.000001
0.272
0.566
146.079
178,588
4
1
0.74
0.403
6
-9.311
0
0.0635
0.509
0.0247
0.104
0.331
138.013
173,120
4
1
0.833
0.813
4
-5.708
0
0.29
0.244
0
0.128
0.705
154.062
217,760
4
1
0.789
0.84
9
-5.29
1
0.097
0.0309
0
0.0916
0.494
136.059
84,000
4
1
0.62
0.573
0
-11.893
1
0.0423
0.271
0
0.0607
0.897
81.548
231,333
4
0
0.752
0.905
11
-7.015
0
0.181
0.0931
0.000739
0.355
0.521
150.991
179,107
4
1
0.701
0.341
1
-12.26
0
0.0418
0.499
0.903
0.359
0.163
105.513
151,507
3
0
0.83
0.707
2
-5.777
1
0.277
0.167
0
0.0797
0.682
146.154
190,685
4
1
0.779
0.705
4
-7.834
0
0.0827
0.277
0
0.0804
0.228
103.048
233,597
4
0
0.263
0.202
1
-17.687
1
0.0408
0.984
0.905
0.089
0.12
71.462
545,747
4
0
0.338
0.988
8
-7.29
0
0.0865
0.000084
0.833
0.0377
0.449
99.046
221,960
4
0
0.814
0.672
9
-12.068
1
0.0619
0.0435
0
0.061
0.933
109.394
300,000
4
0
0.78
0.551
5
-13.038
0
0.0625
0.0613
0.104
0.0331
0.969
126.009
491,933
4
0
0.567
0.797
1
-3.071
0
0.2
0.392
0
0.116
0.654
110.882
218,732
3
1
0.651
0.811
10
-13.87
1
0.0318
0.0648
0.0293
0.1
0.962
112.126
186,573
4
0
0.798
0.564
2
-5.98
1
0.047
0.23
0.000018
0.183
0.394
108.004
254,218
4
0
0.798
0.746
10
-8.639
1
0.0313
0.0304
0.361
0.0703
0.965
128.553
655,213
4
0
0.908
0.61
9
-5.735
1
0.271
0.213
0.000034
0.241
0.443
140.006
197,613
4
1
0.783
0.836
0
-9.223
0
0.0486
0.396
0.0236
0.135
0.831
108.966
222,667
4
0
0.83
0.612
10
-7.446
0
0.079
0.112
0
0.0892
0.252
97.989
243,956
4
1
0.832
0.553
7
-13.705
1
0.0487
0.0422
0.00356
0.249
0.89
119.825
215,693
4
0
0.764
0.812
7
-4.946
1
0.179
0.202
0
0.126
0.742
139.961
194,973
4
1
0.901
0.939
6
-2.762
1
0.274
0.117
0
0.0643
0.805
142.948
356,347
4
1
End of preview. Expand in Data Studio
YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/datasets-cards)

๐ŸŽง Spotify Music Preference Analysis


๐Ÿง  Project Overview

This project analyzes Spotify music data to predict song preferences using machine learning models. The analysis is based on a dataset of 195 songs (100 liked, 95 disliked) with various audio features extracted from Spotify's API.


๐Ÿ“‚ Dataset Description

๐Ÿ“ฅ Data Collection Process

Liked Songs (100 tracks):

  • ๐ŸŽต Primarily French Rap
  • ๐ŸŽธ Some American Rap, Rock, and Electronic music
  • โœ… Represents personal music preferences

Disliked Songs (95 tracks):

  • ๐Ÿค˜ 25 Metal songs (Cannibal Corpse)
  • ๐ŸŽค 20 Rap songs (PNL - personally disliked)
  • ๐ŸŽผ 25 Classical songs
  • ๐Ÿ•บ 25 Disco songs
  • ๐Ÿšซ Pop songs excluded due to neutral preference

๐Ÿ“Š Dataset Structure

The dataset contains 195 rows and 14 columns with the following features:


๐ŸŽผ Audio Features Explanation

๐Ÿ”‘ Key Predictive Features

  • ๐ŸŽต Danceability (0.0-1.0)

    • Measures how suitable a track is for dancing
    • Based on tempo, rhythm stability, beat strength, and regularity
    • Higher values indicate more danceable tracks
  • โšก Energy (0.0-1.0)

    • Represents intensity and activity level
    • Energetic tracks feel fast, loud, and noisy
    • Death metal = high energy, Bach prelude = low energy
  • ๐Ÿ˜Š Valence (0.0-1.0)

    • Musical positiveness measure
    • High valence = happy, cheerful, euphoric
    • Low valence = sad, depressed, angry
  • ๐ŸŽธ Acousticness (0.0-1.0)

    • Confidence measure of acoustic content
    • 1.0 = high confidence the track is acoustic
    • Important for distinguishing electronic vs. acoustic music

๐Ÿงฉ Secondary Features

  • ๐Ÿ—ฃ๏ธ Speechiness (0.0-1.0)

    • Detects spoken words in tracks
    • Above 0.66 = mostly speech (talk shows, audiobooks)
    • 0.33-0.66 = mixed music and speech (rap music)
    • Below 0.33 = mostly music
  • ๐ŸŽผ Instrumentalness (0.0-1.0)

    • Predicts absence of vocals
    • Values above 0.5 likely represent instrumental tracks
    • โ€œOohโ€ and โ€œaahโ€ sounds treated as instrumental
  • ๐Ÿ“ข Liveness (0.0-1.0)

    • Detects audience presence in recordings
    • Above 0.8 = strong likelihood of live performance
    • Useful for distinguishing studio vs. live recordings
  • ๐Ÿ”Š Loudness (dB)

    • Overall track loudness in decibels
    • Typically ranges from -60 to 0 dB
    • Useful for comparing relative loudness between tracks

โš™๏ธ Technical Features

  • ๐Ÿฅ Tempo (BPM)

    • Estimated beats per minute
    • Indicates the speed/pace of the music
    • Directly derived from average beat duration
  • ๐ŸŽน Key (0-11)

    • Musical key using Pitch Class notation
    • 0 = C, 1 = Cโ™ฏ/Dโ™ญ, 2 = D, etc.
    • Important for harmonic analysis
  • ๐Ÿ”‘ Mode (0/1)

    • Musical modality
    • 1 = Major scale, 0 = Minor scale
    • Affects emotional perception of music
  • ๐Ÿ“ Time Signature

    • Number of beats per bar/measure
    • Common values: 3 (waltz), 4 (most popular music)
  • โฑ๏ธ Duration (ms)

    • Track length in milliseconds
    • Useful for identifying song structure preferences

๐Ÿ“Š Data Visualizations

1๏ธโƒฃ Box Plot Analysis

  • Compares each audio feature between liked (1) and disliked (0) songs
  • Helps identify:
    • ๐ŸŽฏ Feature distributions for each preference category
    • โš ๏ธ Outliers in the data
    • ๐Ÿšฆ Clear separations between liked and disliked songs
    • ๐Ÿงช Discriminative features

Boxplot


2๏ธโƒฃ Correlation Heatmap

Reveals:

  • ๐Ÿ” Relationships between audio features
  • ๐Ÿงฌ Multicollinearity issues (highly correlated features)
  • ๐Ÿ” Feature independence for model selection
  • ๐Ÿ› ๏ธ Feature engineering opportunities

Key insights:

  • Energy and loudness โ†’ strong positive correlation
  • Acousticness and energy โ†’ negative correlation
  • Valence โ†’ emotional interpretation link

Boxplot


3๏ธโƒฃ Pair Plot Analysis

  • Shows relationships between: danceability, energy, valence, tempo, acousticness
  • Detects:
    • ๐ŸŽฏ Clustering patterns for liked vs. disliked
    • ๐Ÿค Feature interactions
    • ๐Ÿ“ˆ Distribution shapes

Boxplot


4๏ธโƒฃ Model Performance Comparison

Models Evaluated:

  • โœ… Logistic Regression
  • ๐ŸŒฒ Random Forest
  • ๐Ÿง  Neural Network
  • ๐Ÿ“ K-Nearest Neighbors (KNN)
  • ๐Ÿ› ๏ธ Artificial Neural Network (ANN)
  • ๐Ÿ“ Support Vector Machine (SVM)
  • ๐Ÿ“Š Naive Bayes
  • ๐Ÿš€ XGBoost

Boxplot


๐Ÿง  Key Insights

โœ… Most Important Features:

  • ๐Ÿ˜Š Valence โ€“ correlates with emotion
  • โšก Energy โ€“ identifies genre intensity
  • ๐Ÿ’ƒ Danceability โ€“ relates to rhythm preference
  • ๐ŸŽธ Acousticness โ€“ distinguishes acoustic/electronic
  • ๐Ÿ—ฃ๏ธ Speechiness โ€“ useful for rap detection

โŒ Least Important Features:

  • โฑ๏ธ Duration โ€“ length is less relevant
  • ๐ŸŽน Key โ€“ minimal influence on likability
  • ๐Ÿ“ Time Signature โ€“ usually standard
  • ๐Ÿ“ข Liveness โ€“ studio vs. live not crucial

๐Ÿงช Model Performance Insights

  • ๐ŸŒฒ Ensemble methods (Random Forest, XGBoost) perform best
  • ๐Ÿง  Neural Networks capture complex patterns
  • ๐Ÿงฎ Simple models like Logistic Regression provide baselines
  • ๐Ÿ“Š Performance differences highlight feature complexity

โš™๏ธ Technical Implementation

๐Ÿงผ Data Processing

  • ๐ŸŽฏ Feature Extraction โ€“ Spotify API (audio features)
  • ๐Ÿงน Data Cleaning โ€“ handle nulls/outliers
  • ๐Ÿ“ Feature Scaling โ€“ normalize ranges
  • ๐Ÿ”€ Train-Test Split โ€“ measure generalization

๐Ÿ“ Model Evaluation

  • ๐ŸŽฏ Accuracy โ€“ main performance metric
  • ๐Ÿ” Cross-Validation โ€“ stability check
  • ๐Ÿ“Š Feature Importance โ€“ understand model decisions
  • ๐Ÿงฉ Confusion Matrix โ€“ analyze misclassifications

๐Ÿ’ก Applications

  • ๐ŸŽง Personal Music Recommendation Systems
  • ๐ŸŽถ Understanding Music Preference Patterns
  • ๐Ÿ“ Automated Playlist Generation
  • ๐Ÿ“ˆ Music Streaming Service Improvements
  • ๐Ÿ“Š Market Research for Music Industry

๐Ÿš€ Future Enhancements

  • ๐Ÿ“ˆ Larger Dataset โ€“ more genre diversity
  • ๐Ÿงฉ Additional Features โ€“ genre, artist, release year
  • ๐Ÿค– Advanced Models โ€“ deep learning (e.g. RNN, CNN)
  • ๐ŸŒ Real-Time Prediction โ€“ stream-integrated recommendations
  • ๐Ÿง Collaborative Filtering โ€“ user-based recommendations

๐Ÿ“Ž Dataset

๐Ÿ“ File: [data.csv] Content: Contains 195 rows and 14 audio features used for analysis and modeling.


๐Ÿง  This analysis demonstrates how machine learning can understand and predict personal music preferences using audio features extracted from Spotify's comprehensive music database.

Downloads last month
15