Code Monkey home page Code Monkey logo

machine_learn_songs's Introduction

I presented this app at Turing School of Software & Design's January 2018 Demo Night. This presentation included a demo and a high-level overview of the application. test

General

MachineLearnSongs uses a hand-rolled machine learning algorithm to predict the probabilities of a user liking and disliking songs via Spotify.

Users play a song separately on Spotify, and upon signing in to MachineLearnSongs, the user is able to "Like", "Dislike", and get a prediction for the currently playing song. Once a song is liked or disliked, that preference and the song's audio features (consumed from Spotify's API) are saved to a PostgreSQL database. When the user navigates to the the "Predict" page, a machine learning algorithm, which is coded to execute a Gaussian Naive Bayes classification, uses the user's previous song "likes" and "dislikes" to calculate the percentage chance that a user will like or dislike the currently playing song.

alt text

Technical Details

API

Spotify API

User's authenticate via their Spotify account. The users's currently playing songs and corresponding song audio-features are both consumed.

Machine Learning Component

This application applies the Gaussian Naive Bayes classifier. Refer to presentation (also) linked above for a high-level explanation of how the algorithm works.

machine_learn_songs's People

Contributors

adrian-lara avatar

Watchers

 avatar

machine_learn_songs's Issues

User can ask for a prediction of a song

As a registered user that has like and disliked different songs,
When I visit "/predict", fill in the search field with 'Humble',
And click "Search", and click "Predict"
Then a pop up window appears with a prediction as to whether I'll like this song.

User can search on predict page

As a registered user,
When I visit "/predict", fill in a search field with 'Humble',
And click "Search"
Then I see "Humble" by Kendrick Lamar with a "Predict" button next to the song

User changes like/dislike preference on a song

As a registered user,
When I'm on the "/history"
And, for a song that I've 'liked' before, I click the down arrow,
I've changed the 'like' to 'dislike' in the database,
And the colored arrow is now the down arrow
Also, I'm still on "/history"

As a registered user,
When I'm on the "/history"
And, for a song that I've 'disliked' before, I click the up arrow,
I've changed the 'dislike' to 'like' in the database,
And the colored arrow is now the up arrow
Also, I'm still on "/history"

User visits history page

As a registered user,
When I'm on my dashboard
And click "History",
Then I see a list of songs I've either liked or disliked
Indicated by a colored up arrow or down arrow, respectively
And I'm on the page, "/history"

Test Mock OAuth

Since Omniauth gem isn't being used, I can't leverage the mock_auth method typically used for this.

Create homepage

As a guest,
When I visit the homepage,
Then I see a "Login" link in the center of the page,
A "How It Works" link in the footer of the page,
And "(name of site)" link at the top left of the page.

Display Current Song on User Dashboard

As a registered user (that's currently playing a song on Spotify),
When I visit the "/login" page, enter my information, and click "Log In",
Then I'm redirected to my dashboard,
And I see the song I'm currently playing
And I see a button to "Like" as well as a button to "Dislike"

Prediction results are dope

As a user (playing a song on Spotify and having liked and disliked many songs),
When I'm on the prediction page
And I click on "Predict",
Then I see the prediction results in the form of a real time colored bar. (like score is green and dislike color is red [like buttons])

Display "Play Song.." Message on User Dashboard

As a registered user (that's NOT currently playing a song on Spotify),
When I visit the "/login" page, enter my information, and click "Log In",
Then I'm redirected to my dashboard,
And I see "Play a song on Spotify!"

User dislikes a song test

As a registered user (that's currently playing a song on Spotify),
When I visit my dashboad
And click the "Dislike" button for the song currently playing,
Then that song, it's spotify analytics, and the "dislike" choice are saved to the database
I'm on the page, and the "Dislike" button is a different color

User visits predict page

As a registered user,
When I visit my dashboard, click "Predict",
Then I'm now on "/predict",
And I see the song I'm currently playing

Implement Spotify OAuth

As a registered user with Spotify,
When I visit the "/login" page, enter my information, and click "Log In",
Then I'm redirected to my dashboard,
And I see my Spotify username

User likes a song

As a registered user (that's currently playing a song on Spotify),
When I visit my dashboard
And click the "Like" button for the song currently playing,
Then that song, it's spotify analytics, and the "like" are saved to the database
I'm on the page, and the "Like" button is a different color

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.