Giter Club home page Giter Club logo

music-recommender-system's Introduction

Overview

Recommendation systems are essential for delivering personalized song suggestions on platforms like Spotify and YouTube Music. In applications like Music retrieval system, where recommendations play a big role, it is important to use enhanced content-based similarity by learning from a subset of collaborative filter data, addressing the limitations of collaborative filtering in music recommendation tasks, particularly for new or less popular items. Various algorithms underpin recommendation systems, including popularity-based recommendations, collaborative filtering, and content-based filtering. Popularity-based recommendations emphasize an item's popularity, such as the number of listens a song receives or the unique users that have engaged with it. In this report, we explore our implementation of a popularity-based baseline model, a latent-factor model using Alternating-Least Squares (ALS) for song recommendations, utilizing the ListenBrainz dataset to create a tailored recommender system. We also implement a single-machine implementation of the LightFM model and benchmark the comparison of the training time and precision accuracy for the ALS and LightFM implementations.

The data set

In this project, we'll use the ListenBrainz dataset, which is for use in Google Dataproc's HDFS or any other HPC cluster as well.

This data consists of implicit feedback from music listening behavior, spanning several thousand users and tens of millions of songs. Each observation consists of a single interaction between a user and a song. Note: this is real data. It may contain offensive language (e.g. in song titles or artist names). It is entirely possible to complete the assignment using only the interaction data and ID fields without investigating metadata.

Basic recommender system

  1. As a first step, we partition the interaction data into training and validation samples using the preprocess.py script.

  2. Before implementing a sophisticated model, we begin with a popularity baseline model. The code for this is in the baseline_popularity.py script.

  3. Our model uses Spark's alternating least squares (ALS) method to learn latent factor representations for users and items. Be sure to thoroughly read through the documentation on the pyspark.ml.recommendation module before getting started. This model has some hyper-parameters that we tune to optimize performance on the validation set using grid search methods, notably:

    • the rank (dimension) of the latent factors,
    • implicit feedback parameter (alpha),
    • the regularization parameter.

Evaluation

In assessing both our models - Baseline popularity based model and the ALS- Latent Factor Model, we utilize two key metrics: pre- cision and Mean Average Precision (MAP). Precision is used to calculate the ratio of pertinent instances within the instances that have been retrieved, while ’Precision at k’ quantifies the accuracy of the model’s predictions within the top ’k’ user recommendations.

Documentation

Please refer to the final report (Recommender_System.pdf) document for a detailed explanation of the approach as well as the results.

Single-Machine Implementation

  • Comparison to single-machine implementations: compare Spark's parallel ALS model to a single-machine implementation, e.g. lightfm or lenskit. Our comparison should measure both efficiency (model fitting time as a function of data set size) and resulting accuracy.

Results

  • The results for the popularity-based model are:
precision@100 - 0.05
mAP Score - 0.16
  • The results for the ALS-based Latent factor model are:
precision@100 - 0.22
mAP Score - 0.25
  • The results for LightFM (single-machine implementation) model are:
precision@100 - 0.14
  • However, the LightFM version could converge in a 10-times less time than the ALS-based latent factor model, greatly reducing the training time for the recommender system.

music-recommender-system's People

Contributors

pradhyumn avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

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.