0% found this document useful (0 votes)
171 views6 pages

User Based Spotify Recommendation System Using Machine Learning Algorithms

We have described a personalized music recommendation system using K-nearest neighbour that is KNN and machine learning methods
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
171 views6 pages

User Based Spotify Recommendation System Using Machine Learning Algorithms

We have described a personalized music recommendation system using K-nearest neighbour that is KNN and machine learning methods
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Volume 8, Issue 4, April – 2023 International Journal of Innovative Science and Research Technology

ISSN No:-2456-2165

User Based Spotify Recommendation System using


Machine Learning Algorithms
Dr. Mahaboob Basha. Sk.1, S. Sriharsha3,
Professor, UG Scholar, Dept. of IT,
NRI Institute of Technology, A.P, India-521212 NRI Institute of Technology, A.P-521212

L.Vyshnavi2, G.Dhathrik4
UG Scholar, Dept. of IT, UG Scholar, Dept. of IT,
NRI Institute of Technology, A.P-521212 NRI Institute of Technology, A.P-521212

Abstract:- We have described a personalized music an application by recommending the most acceptable
recommendation system using K-nearest neighbour that and personalized services for each and every user.
is KNN and machine learning methods in this paper. We
present a collaborative filtering and content filtering Keywords: K-NN, SVM, Multiple Linear Regression,
recommendation algorithm to combine the output of the Random Forest Regression, Popularity Model, Content-
network with the log files to recommend music to the Based Model, Collaborative Filtering.
user in a personalized music recommendation system.
The recommended system includes log files that store the I. INTRODUCTION
past or viewed history of the user's music playlist. The
propound music exhortation system pulls the consumer's Everyone’s taste in music is unique, which means that
the beyond records from the log file and provides track no matter what music you make, someone is always bound
tips for each recommendation. Content-based to enjoy listening to it. While the music industry may favor
approaches make suggestions based on the audio certain types of music compared to others, it is important to
characteristics. Speedy development of cell phones and understand that there isn't a single human culture on earth
internet has made possible for us to access various music that has existed without music. Music is such a great bliss to
resources freely. While the music industry may favour us, regardless of whether we are renowned recording artists,
certain types of music more than others, it is salient to karaoke singers, or merely fans of music. The number of
understand that there isn’t a single human culture on songs available increases the listening capacity of every
earth that has existed without music. In this paper, we single individual. According to disclose of MarsBands.com,
have sketched, implemented and examined a song there are at least ninety-seven million songs. These are the
recommendation system. We have used Song text only songs officially released. If we included songs
provided to find relationship between users and songs everyone knows or the incredibly old Celtic songs with no
and to seek from the preceding listening history of users names, we would nearly reach 200 million songs, since the
to deliver recommendations for songs which users may website mostly does not add Happy Birthday or an
prefer to listen mostly. The dataset bottles up over inexpressible song from 1400 A.C. This is when we only
10,000 songs and listeners are advocated the first-class add artists whose names are officially on music charts.
available songs based totally at the mood, style, artist
and top charts of that yr. With a powerful interactive UI, Starting there, let's say that there are presently around
we show the listener the cover songs that were played the one million songwriters active that we know about. Using
maximum and top charts of the year. Listener also have the same percentage as above, we can estimate that there
an option to select his/her favourite artist and albums on have been approximately 15.3 million songwriters
which songs are recommended to them by utilizing the throughout history. To get an innovative idea, there are four
dataset. A recommendation system plays a important million songs on Spotify that have never been played. In
role in providing a well user experience in an application total, there must be billions of songs there, and Spotify itself
by providing the most suitable and personalized services is by no means the limit of music. There are trillions and
for each and every user. Currently, Spotify has one fifty- trillions of songs in the world, so many that an estimate is
five million premium subscribers and three forty five impossible, and the potential for an infinitely greater number
million active users. Spotify’s recommendation system that have not yet been made, creating a world of music for
has also played a dominant role in the success of Spotify. us to enjoy. Keeping this general idea in mind, one can see
In the modern years, music and movie flowing services that the number of songs is too high for a person, even if
have grown extremely. Currently, Netflix and Spotify listening to music is his or her best hobby. People
have a bulk number of users, which has made these sometimes find it difficult to pick from millions of songs.
spurting services victorious. A recommendation system Moreover, music service providers need an efficient way to
plays a vital role in providing a well user experience in manage songs and help their customers discover music by
giving quality recommendations. This means it not only

IJISRT23APR1762 www.ijisrt.com 1698


Volume 8, Issue 4, April – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
gives the user freedom to select the songs he or she wants to solve both linear and nonlinear problems. SVM is a
listen to but also recommends songs according to their fundamental idea:
previous listening history. Thus, there is a solid need for a
good recommendation system. In order to effectively access, The approach uses a line or hyperplane to partition the
discover, and present music content to the final user, data into classes. It separates the words into categories
techniques for searching, retrieving, and recommending during the training phase, such as happy, sad, and so on,
need to be appropriate for music content. There has been based on the training dataset, and then predicts the mood of
some work done by both savants and the industry to provide the input song based on the words and the correspondingly
music recommendation services. score. The top similarity songs' moods are predicted using
SVM and arranged in increasing order, after which songs
with the same mood are suggested. (fig:2)

Fig 1 Spotify Music

 Technologies Used:

Fig 3 SVM

 K-NN:
The K-Nearest Neighbor (K-NN) model for
recommendations is an item-based strategy that searches for
neighbors between objects, in contrast to user-based
algorithms that look for neighbors between users. The best
model for implementing item-based collaborative filtering
and a great place to start when developing a
recommendation system is K-Nearest Neighbor. A non-
parametric learning technique is the K-NN approach. This
technique uses a database with categorized data points to
draw conclusions for new samples. K-NN makes no
assumptions about the distribution of the underlying data
and only relies on the similarity of item attributes. K-NN
ranks the "distance" between each item in the database and
the target item when it arrives to a decision about an item.
Fig 2 Technologies Used
The top K items are then suggested as the most
 SVM: comparable items.
A supervised machine learning method called SVM
(Support Vector Machine) can be utilized to resolve The K-Nearest Neighbors method's algorithm is as
classification and regression issues. However, it is usually follows: 2012 (Han et al.)
used to address categorization issues. The value of each
feature corresponds to a certain coordinate in the SVM
 Establish the parameter k (number of nearest neighbors).
algorithm, and each piece of data is represented as a point in
 Determine the separation between all training data and
n-dimensional space (where n is the number of features you the data that will be examined.
have).  Sort the distances created (in ascending order) and find
the one that is the closest.
A linear model called the Support Vector Machine, or  Include the proper class (c).
SVM, can be used to address classification and regression  Determine how many classes are closest neighbors, and
problems. It is helpful for a variety of applications and can then identify the class as the data evaluation. [fig:4]

IJISRT23APR1762 www.ijisrt.com 1699


Volume 8, Issue 4, April – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
The gathered data was trained and modeled using machine
learning methods. Eighty percent of the data were used for
the model's training, and the remaining twenty percent were
used for testing.

In this work, linear regression, random forest


regression, and gradient boosting regression were employed
as machine learning techniques. Regression analysis is a
statistical technique for determining the relationship
between various variables. When one of the independent
variables changes while the other variables remain constant,
regression analysis is used to determine how the value of the
dependent variable changes. Multiple linear models are
linear regression models with more than one independent
Fig 4 K-NN variable. Below is an illustration of a multiple linear
regression where Y is the dependent variable and X1, X2 are
 Multiple Linear Regression: the independent variables.
Similar to linear regression, multiple regression
attempts to predict a value based on two or more factors, but Y = a + b1*X1 + b2*X2 + ... + bp*Xp
with more than one independent value.
As a result, machine learning has adapted linear
Multiple linear regression, or simply "multiple regression, which was created in the field of statistics and is
regression," is a statistical method for predicting the result examined as a model for understanding the relationship
of a response variable that makes use of a number of between input and output numerical variables. Now, it
explanatory variables. One explanatory variable is used just functions as both a statistical and a machine learning
once in multiple regression, an extension of linear (OLS) method. Different machine learning applications can employ
regression. [fig:4] decision trees. A decision tree builds a tree that is used for
regression and classification. However, trees that have been
 Random Forest Regression: grown very deeply to learn extremely irregular patterns have
Every decision tree has a significant variance, but a tendency to over fit the training sets. The tree might
when we mix them all in parallel, the resulting variance is develop in a totally different way as a result of a small
low since each decision tree is perfectly trained on the amount of data noise. Ensemble methods include building
sample data in question. As a result, the outcome is numerous models and combining them to achieve better
dependent on numerous decision trees rather than just one. outcomes. Ensemble approaches refer to both Random
The majority voting classifier is used to determine the final Forests and gradient boosted trees.
output in a classification challenge. The final output in a
regression problem is the mean of all the outputs. Multiple weak learners, such decision trees, are
Aggregation describes this section. Using several decision combined using ensemble methods to create a powerful
trees and a method called Bootstrap and Aggregation, learner, like random forest. Third International Conference
Random Forest an ensemble methodology capable of on Trends in Electronic and Informatics Proceedings (ICOEI
handling both regression and classification problems. 2019) ISBN: 978-1-5386-9439-8; IEEE Xplore Part
Number: CFP19J32-ART; 19/$31.00 ©2019 IEEE 1361
The central idea is to use a combination of decision Both gradient-boosted trees and random forests can be
trees to determine the final output rather than relying on applied to classification and regression applications.
individual decision trees. Random Forest has multiple Different machine learning applications can employ
decision trees as its base learning models. We randomly decision trees. A decision tree builds a tree that is used for
perform row sampling and feature sampling from the regression and classification. However, trees that have been
dataset, forming sample datasets for every model. This part grown very deeply to learn extremely irregular patterns have
is called Bootstrap. Nifty500 index represents the top 500 a tendency to overfit the training sets.
companies based on full market capitalization from the
companies listed in National Stock Exchange. Inflation is The tree might develop in a totally different way as a
represented by the Consumer Price Index, with 2001 as the result of a small amount of data noise. With the aid of many
base year. decision trees and a method called Bootstrap Aggregation,
also referred to as bagging, a Random Forest is an ensemble
For deposits lasting more than a year, the term "deposit methodology capable of handling both regression and
rate" is used as a proxy for the "interest rate." The gold price classification tasks. This method's fundamental principle is
is expressed as the spot price in rupees per ounce. For each to integrate several decision trees to get the final result
of these variables, monthly data were gathered from January rather than depending solely on one decision tree. To lower
2000 to December 2018. These data were retrieved from the the variance and preserve the low bias produced by a
Center for Monitoring the Indian Economy's databases. For Decision Tree model, the Random Forest performs
every one of these variables, there were 228 observations. bootstrapping on Decision Trees. [fig:2]

IJISRT23APR1762 www.ijisrt.com 1700


Volume 8, Issue 4, April – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
 Software Requirements Specification: a collaborative filtering model based on items. For training,
the listen count parameter is used as implicit feedback.

When comparing two items, we examine the set of


items the target user has rated, determine how similar they
are to the target item I, and then choose the K items that are
the most comparable. The cosine similarity function is used
to calculate the similarity between two items by first
obtaining the user ratings for both items.

The forecast is then calculated by taking a weighted


average of the target user's ratings on these similar products
once we have determined how similar the items are. The
formula used to determine rating is very similar to user-
based collaborative filtering, with the exception that weights
are assigned to items rather than persons. [fig:5]

 Existing System:
Reinforcement learning, or RL, is a type of machine
learning model that responds to its happening environment
in an effort to maximize the ultimate, long-term reward,
Fig 5 SRS
whatever that may be. In our case, that reward is our users'
 Popularity Model:
long-term satisfaction with Spotify. RL isn't about short-
It is a straightforward model that ranks the songs in the
term solutions. It's always playing the long game. In other
training set in order of decreasing popularity and suggests words, rather than handing users the "empty calories" of a
the most well-liked ones. This approach disregards the content diet that will only satisfy them in the moment, RL
preferences of the user. [fig:5]
aims to push them toward a more live able, diverse, and
fulfilling content diet that will last one's time. This could
 Content Based Model:
mean playing an advanced dance track we think might fit a
A representation of the item and a profile of the user's
user's present mood, or it could mean suggesting a calming,
preferences serve as the foundation for content-based
ambient piece to help them study.
filtering techniques. Recommendation is treated as a user-
specific classification problem by content-based After that e-commerce gained popularity of selling
recommenders, which also learn a classifier for the user's
products and the development of new generation mobile
preferences based on product attributes. phones and innovative inventions like tablets, shopping
become easier than before. Therefore, new kinds of
The system primarily employs two sorts of data to advertising techniques came up. Recommendation systems
build user profiles: a model of the user's preferences and a
are one of the most popular techniques nowadays. They are
history of the user's interactions with the recommender useful for both the company and the user because they
system. Based on song metadata, we constructed a K- increase product sales while reducing the time spent
Nearest Neighbor model to suggest songs. We first built a shopping. However, they have some problems because of
library of songs based on various information elements the huge amount of data. The main problems are being
(artist, genre, etc.), after which we suggested songs that
unable to get really relevant results and being unable to get
were comparable. From among the songs found in the user's
results in a reasonable amount of time.
profile, we choose the k closest neighbors. The nearest
neighbor algorithm, which is based on a ball tree, is used to
 Disadvantages:
alleviate the computing shortcomings of the brute-force
Up until now, a lot of methods have been developed to
method. A data structure created using the ball tree
resolve the problems stated above, such as collaborative
algorithm, which divides data into a series of nesting
filtering and content-based filtering. However, they have
hyperspheres, can be particularly effective on highly
some weaknesses. For example, collaborative filtering has
structured data, even in very high dimensions. [fig:5]
the problem of "cold starts," which means that the
recommendation system cannot produce any suggestions or
 Collaborative Filtering:
recommendations. This difficulty occurs when items are
The propose behind collaborative filtering is that
provided in the system but there are few customers and few
people who have formerly agreed will do so again and that
or no rankings. And in the other example of content-based
they will continue to enjoy the same kinds of things.
filtering, if the content lacks enough information to
distinguish the items precisely, the recommendation cannot
Recommendations are generated by the algorithm
be made. On the other hand, our system should find the
solely based on data from rating profiles for many persons
most accurate recommendations. Our potential users, whom
or things. It generates recommendations using this
we desire to help with their problems, are companies that
neighborhood by identifying peer users or items with rating
use internet utilities to sell their products. And by proposing
histories similar to the current user or item. We have created

IJISRT23APR1762 www.ijisrt.com 1701


Volume 8, Issue 4, April – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
our product to these companies, we will reach users of the  System Architecture:
websites that companies use. Therefore, we will reach both
customers and companies with our system.

 Proposed System:
The creation of a music suggestion app is the major
goal of this endeavor. Users can choose and listen to songs
stored on the device using the program. A log is established
each time a person listens to a certain song. We construct a
recommendation engine using a variety of ways to propose
songs to users.

The primary goal of this proposed system is to increase


the functionality of the current recommendation system.
Traditional music recommendation systems produce
recommendations via collaborative filtering or content-
based filtering. Collaborative filtering and content-based
filtering are combined in hybrid techniques to take
advantage of both of their advantages and disadvantages.
Better user profiles are created through user modelling.

Users and objects are connected via context awareness Fig 6 System Architecture
in situations like working or dancing. Items are tagged with
user reviews in tag-based recommendations. The goal of  Future Scope:
recommendation in the long tail is to reduce the popularity In coming days, the recommendation system plays a
bias. It typically goes hand in hand with collaborative vital in maintaining and developing music systems likewise
filtering and disregards item popularity for content-based improving the user experience.
filtering. Recommendation networks give the
recommendation strategies some new properties. The II. CONCLUSION
creation of playlists can be seen as a variation on top-N
suggestions that satisfies user needs. Group suggestion To improve the quality of music recommendations,
includes some pre- or post-processing, either by combining music recommender systems should first take music genre
several user profiles with shared interests or by combining information into account. Based on the attributes of the
different lists of recommendations into a single list. The songs, the music recommender can make song
system we propose consists of three models. recommendations. By calculating the similarity score for
each recommended song, the music recommender can detect
 Advantages of Proposed System: plagiarism in the dataset used. By comparing the lyrics of
The main aim of any recommendation engine is to the supplied song with all the other songs in the dataset, the
stimulate demand and actively engage users. Primarily a mood of the song is predicted. The anticipated mood and
component of an ecommerce personalization strategy, similarity scores are then used to recommend music
recommendation engines dynamically populate various depending on the mood.
products onto websites, apps, or emails, thus enhancing the
customer experience. Because different music recommender systems operate
in various ways, the complicated nature of machine learning
It provides personalization and thus boosts user systems like the Music Recommendation System cannot
engagement. The recommender system is helpful to both have a uniform framework. Our findings allow us to identify
service providers and users. It saves time for the user in additional music aspects for future research in order to
finding and selecting a perfect song and at the same time, it increase the recommender system's accuracy, such as
also helps service providers retain customers for a longer employing tempo gramme to record the local tempo at a
time on their platform certain time.
REFERENCES

[1]. Balabanović, Marko, and Yoav Shoham. "Fab:


content-based, collaborative recommendation."
Communications of the ACM 40.3 (1997): 66-72.
[2]. Bernhards son, Erik. “Recommendations at Spotify
v4” [Presentation Slides], URL: http:// de.slideshare.
net/MrChrisJohnson/algorithmic-music-
recommendations-at-spotify, [Online; last accessed
June 2016]

IJISRT23APR1762 www.ijisrt.com 1702


Volume 8, Issue 4, April – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
[3]. Bernhards son, Erik. “Nearest neighbour methods BIOGRAPHIES
and vector models – part 1“. URL:
https://erikbern.com/2015/09/24/nearest-neighbor-
methods -vector-models-part-1/. [Online; last
accessed June 2016]
[4]. Dieleman, Sander. “Recommending music on Spotify
with deep learning”.URL: http://benanne.github.io/
2014/08/05/ spotifycnns.html August 05, 2014.
[Online; last accessed June 2016].
[5]. Hu, Yifan, Yehuda Koren, and Chris Volinsky.
"Collaborative filtering for implicit feedback
datasets." Data Mining, 2008. ICDM'08. Eighth Dr. Sk. Mahaboob Basha is presently working as Professor
IEEE International Conference on. Ieee, 2008. in the department of Information Technology at NRI
[6]. Koren, Yehuda, Robert Bell, and Chris Volinsky. Institute of Technology, Vijayawada. He received his
"Matrix factorization techniques for recommender M.Tech degree from Jawaharlal Nehru Technological
systems." Computer 8 (2009): 30-37. University, Kakinada (JNTUK) and Ph.D in Computer
[7]. Pazzani, Michael J., and Daniel Billsus. "Content- Science and Engineering from Acharya Nagarjuna
based recommendation systems." The adaptive web. University(ANU). He has published over 10 research papers
Springer Berlin Heidelberg, 2007. 325-341. in International Conferences and Journals. He has more than
[8]. Spotify Developers. Audio Features [Table File]. 20 years of experience in teaching.
URL: https://developer.spotify.com/web-api/console
/ get-audio-features-track/#complete. [Online; last
accessed June 2016]
[9]. Spotify Webpage. N.p. URL: https://www.spotify.
com/de/. [Online; last accessed June 2016]
[10]. Statista.N.p.URL: http://www.statista.com/statistics/
244995/number-of-paying-spotify-
[11]. Steck, Harald, van Zwol, Roelof, Johnson, Chris.
“Interactive Recommender Systems” [Presentation
Slides], URL: http://de.slideshare.net/MrChrisJohns L. Vyshnavi is currently studying B.Tech with specification
on/interactive-recommender- systems-with-Netflix– of Information Technology in NRI Institute of Technology.
and-Spotify,[Online;lastaccessed June 2016] She done a summer internship project on machine learning.
[12]. Kaggle: Your Machine Learning and Data Science
Community
[13]. Welcome To Colaboratory - Colaboratory
(google.com)

S. Sriharsha is currently studying B.Tech with specification


of Information Technology in NRI Institute of Technology.
He done a summer internship project on machine learning.

G. Dhathrik is currently studying B.Tech with specification


of Information Technology in NRI Institute of Technology.
He done a summer internship project on machine learning.

IJISRT23APR1762 www.ijisrt.com 1703

You might also like