Good Music Classifier
BACK: Navigation
Version 0.01 is out!
People keep recommending me songs to listen to, or I find a really cool album…But I don’t have enough time to listen through all of it and be able to pick out which ones are really good. Introducing.. the good music classifier! I wanted something that I would be able to train a model based on my own personal preferences (and through Spotify’s Audio Features). After creating a model, I can then begin putting in new songs which will then classify music as good, okay, or bad.
Upon further development, I’d like to see this to be almost a kind of social platform where we can log in and see if a song might resonate with a specific friend or not.
Random Notes:
OAuth
Spotify (and most companies now) uses OAuth to log in to their API. OAuth uses tokens which are randomly generated and valid for ~30 minutes. It’s a temporary key.
If you go to https://developer.spotify.com/
and login to your dashboard, you can begin creating apps to talk to the Spotify back-end server.
Here, you can see the Client ID and Client Secret. These are like the user name and password to your apps. The ID is shared between the back-end and the front-end, but the client secret is what the back-end uses. If it receives a request with an incorrect client secret, it will deny the request.
Data Analysis & Classification
Some data analysis at this Jupyter Notebook.
After trying to port the project to Heroku in Jan 2019, I ended up not using R through the Rpy2 package to do data analysis. Instead, I am now looking into learning the API of sk-learn to do everything in the above notebook.
Sac Hacks 2018 Project!
I finally got around to doing the app-dev aspect of this idea on 11/17/18 at Sac Hacks. You can check it with the following links:
Front End can be run by running: npm start
.
In order for this to work, we need a back end server which talks to Spotify’s API to give us an OAuth Token. You can grab an example of that here. You can also start this up using npm start
Lastly, I wanted to make some quick backend to save models so that we handle model saving and loading. I made some quick backend in Flask which also uses RPy2 to call R functions for logistic regression and prediction. Make sure you have the needed dependencies and run python gmc_backend.py
TODO:
- Fix the awful user experience (copy pasting URIs takes forever)
- Do better data analysis via learning sk-learn and pytorch
- Edit some logic here and there with making calls to Spotify API (max 100 songs on training)