Skip to content

Using Supervised Machine Learning to predict the ranking of a music artist.

Notifications You must be signed in to change notification settings

rihp/music-ranking-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Artist ranking predictor.

Supervised Machine Learning

  • Can we predict the global ranking of a music artist?
  • Will Bad Bunny pass Drake when they release new albums?
  • What is the trend in the global ranking?
  • Is the rank metric seasonal?

Using a time series of many artist rankings, we will try to accurately predict what will be their rank in the future.

Proposed data sources:

Consider the use of

  • Reinforcement Learning; as time goes by, the model will learn to return more accurate predictions.
  • Sliding windows; different moments, all time with the same duration.

API ENDPOINT EXAMPLE:

HTTP Endpoint from our api.py

from os import get_params
from flask import app
(...)
from src.predictor import predict

# Artist - Predict CPP (Cross-Platform Performance)
@app.route(/api/artist/<id>/cpp-rank-prediction?days=2)
def predict_cpp(id):
    days = get_params(days)
    return predict(days)

HTTP Response (JSON)

 {
    "obj": [
        {
            "spotify_id": 6970440,
            "predicted_rank": 4,
            "confidence":0.95 ,
            "timestp": "2019-06-09T07:00:00.000Z"
        },
        {
            "spotify_id": 6970440,
            "predicted_rank": 3,
            "confidence":0.75 ,
            "timestp": "2019-06-08T07:00:00.000Z"
        }
    ]
}

Possible graphic representation of the data (MVP):

Considering only the ground truth, plot behavior of the artist ranking vector on matlotlib:

Evolution of artist ranking metric over time.

Delta-time and overall artist rank.

Comparing our predictions with the Ground Truth.

Prediction representation

More possible implementations:

Include a comparison of different machine learning models and their prediction metrics.

Prediction Models Compared

  • Enrich dataframes with Twitter API requests, analyzed by the Google Cloud Natural Language API 1 | API | Languages supported

HTTP Response (Multiple models) (JSON)

 {
    "obj": [
        {
            "spotify_id": 6970440,
            "predictions": [{
                        "spotify_id": 6970440,
                        "predicted_rank": 1,
                        "model": "H2O_AutoML",
                        "confidence":0.85 ,
                        "timestp": "2019-06-06T07:00:00.000Z"
                        },
                        {
                        "spotify_id": 6970440,
                        "predicted_rank": 2,
                        "model": "linear_regressor",
                        "confidence":0.76 ,
                        "timestp": "2019-06-06T07:00:00.000Z"
                        },
                        {
                        "spotify_id": 6970440,
                        "predicted_rank": 2,
                        "model": "GradientBoostingRegressor",
                        "confidence":0.42 ,
                        "timestp": "2019-06-06T07:00:00.000Z"
                        }       
                    ]  
                }
            ]
        }
    ]
}

Bonus (Exposure & Portfolio):

  • Send a tweet when a new prediction is made for an specified artist_id
  • Generate a docker image?
  • Deploy to Heroku?
  • Host portfolio

About

Using Supervised Machine Learning to predict the ranking of a music artist.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published