Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is a really lucky find for me. I was just about to do something to try and get into machine learning. Right now I need some help getting started with writing some machine learning code. I don't know where to start. I've come up with a very simple project that I think this would work very well for.

I want to buy a Raspberry Pi Zero, put it in a nice case, add to push buttons and turn it into a car music player (hook it into the USB charger and 3.5mm jack in my car). The two buttons will be "like" and "skip & dislike". I'll fill it with my music collection, write a python script that just finds a song, plays it, and waits for button clicks.

I want the "like" button to be positive reinforcement and the "skip & dislike" to be negative reinforcement.

Could someone point me in the right direction?



Your usecase reminded me of the Netflix problem, which is given x movies that the user has liked, try to recommend movies to them based on a large dataset that has thousands of users and their movie ratings. For music, there is a similar dataset[1] and problem on Kaggle[2].

The way the system is evaluated is by building a model that will predict what rating the user will give a song even though the user has not rated it yet. Then the difference in predicted and actual rating will be computed as the testing error in the model. Some basic techniques for building a model are regression and matrix factorization using SVD (singular value decomposition).

Your usecase might be slightly different from this problem, because you wouldn't have to predict the rating other users give a song (only for yourself) and you want your model to change on the fly given a skip and dislike. A simple, but possibly effective solution might be to search the music dataset that contains the listening history of 1M users to find songs you haven't rated before and download it to listen.

[1] http://labrosa.ee.columbia.edu/millionsong/ [2] https://www.kaggle.com/c/msdchallenge#description


The main problem is that I'll just be starting with a folder of music friles from iTunes for example and from there I'll build up my like & dislike profile. So basically I'd like to have two vectors. The first being played songs (last 10 or 20), the second being unplayed songs. When the played songs are subtracted, I want to sorted(unplayed, key=some_score)[0] and get the next song to play.

My initial thought was just to keep a full list of songs and their liked, disliked, and ambivilant states. Make some function to score a song based on their distance & # likes from the played vector.

Doing this all by hand would be a LOT of work. Are there any frameworks that do this? Is there any way to interface with them that are strait forward? Do I need to get a PhD before this stuff will come easily to me?

So many questions, so little time.


I'd contend that you won't be starting with a folder of music files from iTunes, but rather you'll have the benefit of the big data that others have gone to the trouble of collating in the form of 1M users' listening histories. From your initial like/dislike profile combined with the listening trends of 1M others, you can discover more implicit information than you can from just your initial like/dislike profile.

The purpose of ML is that you can tell a machine to go through more data than any human can. By expanding the corpus of songs from songs you've heard of to all songs in the big dataset, you will be able to find songs you haven't heard based on others who liked the songs you liked and disliked the songs you disliked.

edit: Maybe I misunderstood the problem you're working on. I thought you wanted to get recommendations of songs to listen to, but now I see that you have a lot of songs you like already, so you just want a song recommended from that list based on some factors like mood, time of day, etc.


The point of the project is to be simple and to collect all the data that I'm going to use to analize from my like and dislike. I want to do this as simply as possible so I can just get my feet wet.

This project also has constraints. It needs to fit in a Raspberry Pi Zero and on a microsd card with no internet connection running off the power from a USB power supply in a car.

It needs to be fast-ish (I can run all of this math at the same time I'm playing the ~3 minute song) and it needs to be small. If I've got 10-20GB of music then songs+os+my data<=32GB. These days I think you can get a Rasbian install ~1-2GB so that leaves us with ~10GB of data if I don't expand my music collection ever because after I get it set up I can't be asked to update it ever again.

So yes for this I just want to start with my music folder. A folder of audio files. No lyrics, no nothing. Just things that can be infered from my like and dislike.


you should just build it and then do the recommendations by a heuristic function. Then you can substitute the function with an ML classifier once you have enough data to train on (and time to learn about ML). Don't wait on ML coding tips for this project


I'm not sure your problem is well defined enough. Do you want the ML to be able to select songs similar to those you've liked? Or would simply keeping track of the number of likes on each song suffice, such that songs with more likes have a higher probability of being played?


Perferably (Ordered by percived difficulty):

    - Prefer songs from most liked genera/artist/album
    - Favor liked song/genera/artist/album & avoid consistantly disliked song/genera/artist/album.
    - If a specific song/genera/artist/album is liked more at a specific time, play it more often at that time.
    - If a song is being played and specific song/genera/artist/album is always liked when it follows this song then favor those. 
    - If you are playing a song and there is a song that is always liked when it follows this song favor that song when choosing the next song.
Possibly (if I decide to devote my life to making a music recommending engine):

    - Corelate GPS location with song choices
    - Corelate weather/humidity/tempature/month with song choices
    - Do NLP sentiment analysis to score all of the songs on an emotional-tone scale to help group them well.
    - Do some DSP on all of the audio to generate a intro and outro beat/rythm profile and attempt to best match the song that will lead to a good enterance/exit.
edit: fixed formatting.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: