1
$\begingroup$

I'm experimenting with using SKLearn on some Spotify playlists. After doing the usual train_test_split I got these coefficients and am trying to draw conclusions from them:

Coeffecient
danceability    -4.196927e-01
loudness    2.698949e-02
speechiness 1.311348e-02
acousticness    -3.046890e-01
liveness    5.364709e-02
valence 1.613084e-01
tempo   1.136266e-04
duration_ms 1.060418e-08

Interpreting the coefficients:

1. Holding all other features fixed, a 1 unit increase in danceability is associated with an increase of -0.4196927 (i.e. a small decrease) in energy. That's odd.
2. A 1 unit increase in loudness is associated with an increase of 0.02698949 in energy. Makes sense.
3. A 1 unit increase in speechiness is associated with an increase of 0.01311348 in energy. This is surprising - I would expect a negative relationship.
4. A 1 unit increase in acousticness is associated with an increase of -0.3046890 (i.e. a decrease) in energy, so, again, acousticness "drains" energy!
5. A 1 unit increase in liveness is associated with an increase of 0.05364709 in energy. Makes sense.
6. A 1 unit increase in valence is associated with an increase of 0.1613084 in energy. Makes sense.
7. A 1 unit increase in tempo is associated with a very small increase of 0.0001136266 in energy. Makes sense.
8. A 1 unit increase in duration_ms is associated with an increase of 0.00000001060418 in energy, so essentially no relationship.

Does this make sense, in the sense of have I actually interpreted the numbers correctly? I haven't studied coefficients in decades, aside from what I've picked up learning python, so I'm definitely open to resources to learn more, if anybody has any suggestions.

$\endgroup$
1
  • $\begingroup$ Assuming this is a linear model for energy as a continuous variable your interpretation looks plausible if scikit-learn works the same way as most statistical programs. $\endgroup$
    – mdewey
    Jun 11, 2020 at 12:29

1 Answer 1

0
$\begingroup$

You should add more details about what you are doing with sklearn. Sklearn has many models, and you are using one of them. Interpretations depend on the model you are using.

Assuming you are using linear regression, and you are using all the variables without any normalization, and assuming linear regression is a good model for this data, yes, your interpretations may be correct. However, all these assumptions are crucial and you might want to dig deeper into each.

$\endgroup$
3
  • $\begingroup$ Some very valid points. I am indeed using linear regression with non-normalized variables, tho this is based more on a desire to explore the various options one-by-one rather than a clear preference over, say, SVM. I hope to have more of an idea what I'm doing as the weeks go on - right now I'm kinda free-wheeling and digging in where things look interesting. Not very scientific, I'll admit. $\endgroup$ Jun 11, 2020 at 21:40
  • $\begingroup$ That's fine. Let me just add that a thorough understanding of linear regression will eventually help a lot in understanding most other methods, including neural networks. $\endgroup$
    – learning
    Jun 12, 2020 at 5:37
  • $\begingroup$ I think you're right. I learned how to run the full battery of ML functions without really understanding what I was doing. Going back through it starting with linear regression seems like a safe bet. $\endgroup$ Jun 12, 2020 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.