# Personalized Music Recommendation Simulation Based on Improved Collaborative Filtering Algorithm

Authors: Hui Ning; Qian Li
Journal: Complexity
 (2020)

---

## Abstract

Collaborative filtering technology is currently the most successful and widely used technology in the recommendation system. It has achieved rapid development in theoretical research and practice. It selects information and similarity relationships based on the user’s history and collects others that are the same as the user’s hobbies. User’s evaluation information is to generate recommendations. The main research is the inadequate combination of context information and the mining of new points of interest in the context-aware recommendation process. On the basis of traditional recommendation technology, in view of the characteristics of the context information in music recommendation, a personalized and personalized music based on popularity prediction is proposed. Recommended algorithm is MRAPP (Media Recommendation Algorithm based on Popularity Prediction). The algorithm first analyzes the user’s contextual information under music recommendation and classifies and models the contextual information. The traditional content-based recommendation technology CB calculates the recommendation results and then, for the problem that content-based recommendation technology cannot recommend new points of interest for users, introduces the concept of popularity. First, we use the memory and forget function to reduce the score and then consider user attributes and product attributes to calculate similarity; secondly, we use logistic regression to train feature weights; finally, appropriate weights are used to combine user-based and item-based collaborative filtering recommendation results. Based on the above improvements, the improved collaborative filtering recommendation algorithm in this paper has greatly improved the prediction accuracy. Through theoretical proof and simulation experiments, the effectiveness of the MRAPP algorithm is demonstrated.


---

## Body

## 1. Introduction

With the rapid development of information technology and the Internet, the resources on the Internet are exploding. On the one hand, the resources that people can get from the Internet are becoming more and more abundant, which brings great convenience to life. On the other hand, the massive information space brings users more diversified choices, but at the same time, users get lost in the ocean of information and have to spend more time and cost to find the information they need, that is, the so-called “information overload” phenomenon. In order to solve these problems, personalized recommendation system is generated, which automatically recommends objects that conform to users’ interest characteristics by using users’ preference information [1, 2].Choosing an appropriate recommendation algorithm is the core and key to the successful application of personalized recommendation system, and the performance of recommendation algorithm also has a direct impact on the recommendation quality. Currently, popular recommendation methods mainly include association rule recommendation, content-based recommendation [3], collaborative filtering recommendation, and hybrid recommendation technology [4, 5]. Among them, collaborative filtering recommendation is the most widely used and successful technique in the field of recommendation, and it is also the most hot spot in the research of recommendation algorithms. Collaborative filtering, also known as social filtering, calculates the similarity of preferences among users and automatically filters and screens target users on the basis of similar users. The basic idea of collaborative filtering is that users have the same or similar values, ideas, knowledge level, and interest preferences, and their demand for information is similar [6, 7]. Therefore, compared with traditional recommendation methods, collaborative filtering technology has a significant advantage in that it can recommend some items that are difficult to carry out content analysis, such as abstract resource objects such as information quality and personal taste. In addition, collaborative filtering technology can effectively use the evaluation information of other users with similar interests, so as to make use of less user feedback, accelerate the speed of personalized learning, and facilitate the discovery of users’ hidden interests [8, 9]. Since the idea of this technology was first proposed in 1992, collaborative filtering technology has attracted more and more scholars’ attention due to its broad application value. Meanwhile, with the launch of Netflix Prize [10, 11], the collaborative filtering algorithm has been promoted to one of the most active research fields in machine learning. Among the many recommendation technologies, content-based recommendation and collaborative filtering recommendation are the most studied. Content-based recommendation is the continuation and development of information filtering technology [12, 13]. The system does not need to obtain users’ comments on projects but only learns the content information of users’ historical selection projects to recommend new projects. In most content-based recommendation systems, the content information of a project is often described in terms of keywords. A typical example is the web recommendation system [14, 15]. For each web page, the system extracts 128 most important keywords to represent it. Because content-based recommendation algorithms are fundamentally based on information extraction and information filtering [16, 17], they belong to the research category of text processing and their theoretical system is relatively mature, so most of the current content-based recommendation systems use the analysis of text attribute information of products to generate recommendations [18]. At the same time, limited by the development of information acquisition technology, content-based recommendation system is also subject to many constraints. For example, with automatic extraction of some video files, images, sound files, and other features of multipersonalized music information, it is faced with great technical difficulties, which also limits the application in related fields [19]. In addition, content-based filtering technology can only recommend items similar to the content attributes of historical interest to users and lacks the ability to explore potential interest of users, which has certain limitations in practical application [20]. In real time and extensibility of collaborative filtering technology and other issues, the researchers put forward the basic idea set up by means of offline user interest model based on the solution and then predict target user’s interest with Bayesian network clustering technology [21, 22], the model was based on dimension reduction techniques and implied theme [23]. The Bayesian network was used to establish the recommendation model, and the research results showed that the algorithm achieved good predictive performance when the user’s preference information was relatively stable, but it was not suitable for the frequently updated system due to the high time cost of modeling [23]. In literature [24], clustering technology is applied to collaborative filtering recommendation. First, users are divided into different groups. When finding close neighbors for target users, the search space can be greatly reduced and the real-time performance of recommendation can be improved, but an obvious defect of this algorithm is that the recommendation accuracy is reduced. Other researchers [25] integrated content-based recommendation and collaborative filtering recommendation and combined their respective advantages to form a hybrid recommendation model, the typical representative of which is the web recommendation system [26]. In recent years, with the rise of probability graph model [27] in machine learning, some researchers try to build recommendation process model from more complex probability model. The concept of multiple interest groups is derived through potential variables by using the semantic analysis of probability latent layer, and the probability of users belonging to each interest group is obtained by learning the user model. Finally, the recommendation system makes recommendations to users according to their different preference levels [28]. The recommendation process is regarded as a sequence based on the Markov decision process, which can predict the probability of the product that the user likes in the future through the existing information, thus generating the recommendation [29]. When the number of users and the number of goods in the recommendation system increases rapidly, the traditional recommendation system is faced with severe challenges in real time and expansibility of the algorithm. The research results of many scholars show that the recommendation accuracy and real-time performance of the recommendation system are usually in contradiction; that is, it is difficult for the recommendation system to ensure the high quality of the recommendation accuracy while meeting the real-time performance requirements. Therefore, on the premise of minimizing the quality of recommendation, how to ensure the real-time performance and scalability of the system is also one of the challenges the recommendation system has been facing.The content-based recommendation is completed above. The advantage of the content-based recommendation system is that it can model the user’s points of interest well and provide more accurate recommendations, but there are inevitably some problems: content-based recommendation method is based on the similarity between the user context and the resource item. The advantage is that it is convenient and effective. The disadvantage is that it is difficult to distinguish the quality and style of the resource content, and it cannot recommend the personalized music resources of potential interest. This paper analyzes the shortcomings of the memory-based collaborative filtering algorithm, summarizes some existing model-based improved collaborative filtering methods, and then proposes a user clustering collaborative filtering algorithm based on singular value decomposition. Also belonging to the algorithm based on the model of collaborative filtering and aiming at the data very sparse, the traditional collaborative filtering is often based on clustering accuracy and the singular value decomposition fill of the original high-dimensional sparse matrix, which gets a score without missing value matrix. By using the K-means clustering on the complete data, cluster users complete the prediction of unknown score on the test set. In order to combine the environmental context information in music recommendation and recommend resources suitable for users’ environment, this paper uses the environmental context to classify resource items and get corresponding sets and then uses Bayesian decision theory to calculate and get the final recommendation results. The simulation environment was established with the current mainstream personalized music recommendation simulation software, the simulation results were compared with the content-based recommendation technology, and the simulation data were analyzed.


## 2. Research on Collaborative Filtering Personalized Music Recommendation

In order to provide information quickly and accurately, the recommendation system, as one of the commonly used methods, firstly establishes the user’s personal information and learns the user’s characteristics, habits, preferences, and other information through the user’s purchase of products, product ratings, and online browsing records. Then, personalized recommendation system will align the users’ personal information to filter out the content of the relevant user. Integration, classification, annotations or index, machine learning, and data mining algorithm are utilized to extract the user’s preferences or features and to help users in the numerous useful part of the information. Finally, recommended meet users expect a commodity service, and the recommendation system the entire framework is shown in Figure1.Figure 1
Schematic diagram of the framework of an improved collaborative filtering personalized music recommendation system.Different recommendation technologies or strategies will produce different recommendation results. According to different recommendation technologies and recommendation strategies, recommendation systems can be divided into three categories:(1)
Nonpersonalized recommendation system: the recommendation system of this recommendation system for each user is exactly the same and popular, for example, the ranking of products sold on e-commerce sites, the hottest music on music sites, and popular posts on community forums.(2)
Semipersonalized recommendation system: this type of recommendation system has a higher degree of personalization than a nonpersonalized recommendation system. By analyzing the user’s browsing behavior or shopping basket data characteristics, it mines the user's interest preferences and generates recommendations.(3)
Completely personalized recommendation system: the recommendation system needs to retain various historical information of users, such as registration information, browsing information, purchase information, and historical evaluation data. Based on the user’s long-term stable interests and preferences, combining with current behavior is to generate personalized recommendations.According to the characteristics of recommended objects, recommendation systems can be divided into recommendation systems with web pages as the main recommendation objects and e-commerce recommendation systems with products as the recommendation objects.


### 2.1. Context-Aware Personalized Music Recommendation

Context-aware technology is an important aspect that needs to be considered in an intelligent recommendation system. In pervasive computing, computer-supported collaborative work, and human-computer interaction, context and context awareness have become hot research topics in recent years. Context-aware technology is to discover the constantly changing contextual information in the environment and make corresponding behaviors based on the changing information of the context, thereby providing support for personalized music applications in a pervasive personalized music environment. Based on context-aware technology in pervasive computing, there are many researches, such as context modeling technology, context acquisition technology, context preprocessing technology, context reasoning technology, and context inconsistency detection technology. Because of the differences in context types and their perception methods, the development of context-aware systems for specific needs lacks a unified programming mechanism and architecture, which increases the manpower and material resources for system development. Some researchers have proposed to separate the low-level context information collection and processing process from the high-level applications and cover all the information processing processes through middleware, thereby reducing the development cost of the context-aware recommendation system. Context awareness is a mechanism used to help applications adjust their behavior to adapt to changing contexts. The context awareness process is shown in Figure2.Figure 2
Context-awareness flowchart.Context-aware content-based recommendation is a technology that provides users with recommendation services based on the similarities between item content. For example, an online music website user actively evaluates a nostalgic song, and then the system will actively recommend other nostalgic songs to the user. It first creates a user profile file based on the items that the user has evaluated in the past and then predicts the items that the user may be interested in based on the correlation between the user profile and the item content characteristics and provides this item to the user. The matching degree of item content features and user profile features has a great impact on the content-based recommendation effect. If the content feature of an item matches the user feature information in the user profile file, it indicates that the item is of interest to the user. The user profile file is a data structure used by most recommendation systems at present. It needs to be dynamically created and updated based on the feedback information of the recommended user. It is used to record and describe various types of information related to the user. Can the user profile file be the accurate reflection of user preferences determines the recommendation effect of the content-based recommendation system.


### 2.2. Collaborative Filter Music Recommendation

Collaborative filtering is also called social filtering. It calculates the similarity of preferences between users and automatically filters and screens target users on the basis of similar users. The basic idea is to have the same or similar values, ideas, and knowledge level, and users with interests and preferences have similar needs for information. Therefore, compared with traditional recommendation methods, a significant advantage of collaborative filtering technology is that there are no special requirements for the recommended objects. It can also be recommended for some abstract items that are difficult to analyze content, such as information quality and personal taste. In addition, the collaborative filtering technology extracts information from browsing/searching behavior, purchase history, or product ratings when analyzing user interests. The entire recommendation process does not need to disturb the user’s visit, which improves the user’s experience of using the system. Collaborative filtering technology has received more and more successful applications and has also received more and more attention from the academic community. Research on collaborative filtering algorithms has become the most active field in current personalized recommendation technology. The principle is shown in Figure3.Figure 3
Collaborative filtering music recommendation.The user-based collaborative filtering algorithm believes that users with similar interests and hobbies have similar evaluations of most other items. When recommending for target users, the rating information of neighbor users with similar hobbies is used as a reference. The recommendation process can be divided into three stages: scoring description, nearest neighbor search, and predicting scoring and generating recommendation list.


#### 2.2.1. Step 1: Rating Description

The user’s rating of the item can usually be expressed by the uxp order matrix. Among them,u represents the number of users, p represents the number of items, and the element t in the i th row and the J column represents the rating value of the item J by the user i, which reflects the user’s preference for the item, as shown in Table 1.Table 1
User project evaluation matrix.
Project 1ProjectjProjectPUser 1t1,1t1,jt1,pUseriti,1ti,jti,pUserutu,1tu,jtu,p


#### 2.2.2. Step 2: Find Nearest Neighbors

In this stage, by calculating the similarity between users, the Top-N users with the highest similarity are selected as the nearest neighbor set of the target user. Nearest neighbor search is the key to the user-based CF algorithm. The commonly used user similarity calculation methods mainly include cosine similarity, correlation similarity (also called Pearson coefficient correlation), and modified cosine similarity.


#### 2.2.3. Step 3: Predict the Score and Generate Recommendations

After the nearest neighbor set is determined, the following can make recommendations based on the scores of the set users. The collaborative filtering recommendation result includes the user’s predicted scoring value for the unrated items and the Top-N item set. Many previous research results pay more attention to prediction accuracy and believe that the closer the predicted score value is to the actual score, the higher the quality of the system recommendation is. However, a low prediction error cannot guarantee a good recommendation quality, and sometimes, the Top-N recommendation item set is more meaningful to the recommendation system.Suppose the item set jointly scored by useri and user j is I, then Pearson correlation can be used to obtain the similarity between the two sim(i, j) is(1)simi,j=∑Ei,n−Ei¯Ej,n−Ej¯∑Ei,n−Ei¯Ej,n−Ej¯2.The user’s predicted score for the unrated item: assumingNn=n1…nl is the nearest neighbor set of the target user, the predicted score Sn,j of the user u for the unrated item i can be expressed as(2)Sn,j=∑tvi−tjsimn,v∑simn,v+tn¯.The coefficient is used to measure the degree of overlap of binary data, which is defined as follows:(3)simi,j=Ei∩EjEi∪Ej.The algorithm defines the key wordK, and the importance of w to a text D can be expressed by the following formula:(4)wi,j=eimaxeijlogIei.


## 2.1. Context-Aware Personalized Music Recommendation

Context-aware technology is an important aspect that needs to be considered in an intelligent recommendation system. In pervasive computing, computer-supported collaborative work, and human-computer interaction, context and context awareness have become hot research topics in recent years. Context-aware technology is to discover the constantly changing contextual information in the environment and make corresponding behaviors based on the changing information of the context, thereby providing support for personalized music applications in a pervasive personalized music environment. Based on context-aware technology in pervasive computing, there are many researches, such as context modeling technology, context acquisition technology, context preprocessing technology, context reasoning technology, and context inconsistency detection technology. Because of the differences in context types and their perception methods, the development of context-aware systems for specific needs lacks a unified programming mechanism and architecture, which increases the manpower and material resources for system development. Some researchers have proposed to separate the low-level context information collection and processing process from the high-level applications and cover all the information processing processes through middleware, thereby reducing the development cost of the context-aware recommendation system. Context awareness is a mechanism used to help applications adjust their behavior to adapt to changing contexts. The context awareness process is shown in Figure2.Figure 2
Context-awareness flowchart.Context-aware content-based recommendation is a technology that provides users with recommendation services based on the similarities between item content. For example, an online music website user actively evaluates a nostalgic song, and then the system will actively recommend other nostalgic songs to the user. It first creates a user profile file based on the items that the user has evaluated in the past and then predicts the items that the user may be interested in based on the correlation between the user profile and the item content characteristics and provides this item to the user. The matching degree of item content features and user profile features has a great impact on the content-based recommendation effect. If the content feature of an item matches the user feature information in the user profile file, it indicates that the item is of interest to the user. The user profile file is a data structure used by most recommendation systems at present. It needs to be dynamically created and updated based on the feedback information of the recommended user. It is used to record and describe various types of information related to the user. Can the user profile file be the accurate reflection of user preferences determines the recommendation effect of the content-based recommendation system.


## 2.2. Collaborative Filter Music Recommendation

Collaborative filtering is also called social filtering. It calculates the similarity of preferences between users and automatically filters and screens target users on the basis of similar users. The basic idea is to have the same or similar values, ideas, and knowledge level, and users with interests and preferences have similar needs for information. Therefore, compared with traditional recommendation methods, a significant advantage of collaborative filtering technology is that there are no special requirements for the recommended objects. It can also be recommended for some abstract items that are difficult to analyze content, such as information quality and personal taste. In addition, the collaborative filtering technology extracts information from browsing/searching behavior, purchase history, or product ratings when analyzing user interests. The entire recommendation process does not need to disturb the user’s visit, which improves the user’s experience of using the system. Collaborative filtering technology has received more and more successful applications and has also received more and more attention from the academic community. Research on collaborative filtering algorithms has become the most active field in current personalized recommendation technology. The principle is shown in Figure3.Figure 3
Collaborative filtering music recommendation.The user-based collaborative filtering algorithm believes that users with similar interests and hobbies have similar evaluations of most other items. When recommending for target users, the rating information of neighbor users with similar hobbies is used as a reference. The recommendation process can be divided into three stages: scoring description, nearest neighbor search, and predicting scoring and generating recommendation list.


### 2.2.1. Step 1: Rating Description

The user’s rating of the item can usually be expressed by the uxp order matrix. Among them,u represents the number of users, p represents the number of items, and the element t in the i th row and the J column represents the rating value of the item J by the user i, which reflects the user’s preference for the item, as shown in Table 1.Table 1
User project evaluation matrix.
Project 1ProjectjProjectPUser 1t1,1t1,jt1,pUseriti,1ti,jti,pUserutu,1tu,jtu,p


### 2.2.2. Step 2: Find Nearest Neighbors

In this stage, by calculating the similarity between users, the Top-N users with the highest similarity are selected as the nearest neighbor set of the target user. Nearest neighbor search is the key to the user-based CF algorithm. The commonly used user similarity calculation methods mainly include cosine similarity, correlation similarity (also called Pearson coefficient correlation), and modified cosine similarity.


### 2.2.3. Step 3: Predict the Score and Generate Recommendations

After the nearest neighbor set is determined, the following can make recommendations based on the scores of the set users. The collaborative filtering recommendation result includes the user’s predicted scoring value for the unrated items and the Top-N item set. Many previous research results pay more attention to prediction accuracy and believe that the closer the predicted score value is to the actual score, the higher the quality of the system recommendation is. However, a low prediction error cannot guarantee a good recommendation quality, and sometimes, the Top-N recommendation item set is more meaningful to the recommendation system.Suppose the item set jointly scored by useri and user j is I, then Pearson correlation can be used to obtain the similarity between the two sim(i, j) is(1)simi,j=∑Ei,n−Ei¯Ej,n−Ej¯∑Ei,n−Ei¯Ej,n−Ej¯2.The user’s predicted score for the unrated item: assumingNn=n1…nl is the nearest neighbor set of the target user, the predicted score Sn,j of the user u for the unrated item i can be expressed as(2)Sn,j=∑tvi−tjsimn,v∑simn,v+tn¯.The coefficient is used to measure the degree of overlap of binary data, which is defined as follows:(3)simi,j=Ei∩EjEi∪Ej.The algorithm defines the key wordK, and the importance of w to a text D can be expressed by the following formula:(4)wi,j=eimaxeijlogIei.


## 2.2.1. Step 1: Rating Description

The user’s rating of the item can usually be expressed by the uxp order matrix. Among them,u represents the number of users, p represents the number of items, and the element t in the i th row and the J column represents the rating value of the item J by the user i, which reflects the user’s preference for the item, as shown in Table 1.Table 1
User project evaluation matrix.
Project 1ProjectjProjectPUser 1t1,1t1,jt1,pUseriti,1ti,jti,pUserutu,1tu,jtu,p


## 2.2.2. Step 2: Find Nearest Neighbors

In this stage, by calculating the similarity between users, the Top-N users with the highest similarity are selected as the nearest neighbor set of the target user. Nearest neighbor search is the key to the user-based CF algorithm. The commonly used user similarity calculation methods mainly include cosine similarity, correlation similarity (also called Pearson coefficient correlation), and modified cosine similarity.


## 2.2.3. Step 3: Predict the Score and Generate Recommendations

After the nearest neighbor set is determined, the following can make recommendations based on the scores of the set users. The collaborative filtering recommendation result includes the user’s predicted scoring value for the unrated items and the Top-N item set. Many previous research results pay more attention to prediction accuracy and believe that the closer the predicted score value is to the actual score, the higher the quality of the system recommendation is. However, a low prediction error cannot guarantee a good recommendation quality, and sometimes, the Top-N recommendation item set is more meaningful to the recommendation system.Suppose the item set jointly scored by useri and user j is I, then Pearson correlation can be used to obtain the similarity between the two sim(i, j) is(1)simi,j=∑Ei,n−Ei¯Ej,n−Ej¯∑Ei,n−Ei¯Ej,n−Ej¯2.The user’s predicted score for the unrated item: assumingNn=n1…nl is the nearest neighbor set of the target user, the predicted score Sn,j of the user u for the unrated item i can be expressed as(2)Sn,j=∑tvi−tjsimn,v∑simn,v+tn¯.The coefficient is used to measure the degree of overlap of binary data, which is defined as follows:(3)simi,j=Ei∩EjEi∪Ej.The algorithm defines the key wordK, and the importance of w to a text D can be expressed by the following formula:(4)wi,j=eimaxeijlogIei.


## 3. Popularity Prediction Based on Improved Collaborative Filtering and Personalized Music Recommendation

Popularity-based personalized music recommendation algorithm is based on music recommendation. It studies the personalized personalized music recommendation problem for personalized music recommendation users. This article combines content-based recommendation technology, popularity multiple linear regression, and Bayesian. The decision-making technology fully integrates the contextual information in personalized music recommendation, which not only solves the problem of the inability to recommend new points of interest for users in content-based recommendation technology but also the one-sidedness of contextual information in traditional recommendation technology. The algorithm process is as follows:(1)
Collect user context information in music recommendation and classify the context information into user preference context information, environment context information, and device context information.(2)
User preference contextual information and personalized music resource list as input, using content-based recommendation technology to output the resource recommendation set R1 that the user is interested in.(3)
The server-side personalized music resource item popularity statistics value is used as input, using multiple linear regression technology to calculate the popularity prediction value of the personalized music resource item and select the personalized music resource with a larger popularity prediction value and output the resource recommended collection Rz.(4)
Based on the set R, and Rz, calculate the new resource set R3 that the personalized music recommendation user has not discovered.(5)
Set R3 and environmental context information as input and use Bayesian decision-making technology to obtain a personalized music resource recommendation set R.(6)
According to the user’s device context information, the resources in the set R are recommended to the user in a format supported by the user’s device.In reality, the similarity between users is not only related to the user’s rating of the item but also related to the user’s preference for a certain type of item. When two users’ rating items have similar attributes, the two can be considered there are also high similarities between users. A project may contain multiple categories of attributes; for example, a movie may be both a romance and a comedy. The target user’s attribute preference for the item should be similar to the neighbor’s attribute preference for the item. For example, if there are too many comedies in the evaluation movies of the target user, the generated neighbor users are more likely to evaluate comedies. Therefore, combining the similarity of item attributes with the traditional item-based similarity calculation method can improve the recommendation accuracy of the recommendation system.A basic assumption of the improved collaborative filtering algorithm is that users with similar preferences will give similar ratings to the same items. Therefore, after the target user’s nearest neighbor set is generated, the target user’s score for the unscored items can be predicted based on the user’s score in the nearest neighbor set. At present, the two commonly used prediction methods are shown in the following formula:(5)Pn,i=∑simi,j×Ei,j∑simi,j,Pn,j=∑Ei,j−Ei×simi,j∑simi,j+En¯.Pn,i TT represents the predicted score of user U for project I, E represents the nearest neighbor set of target user I, and Ei,j represents the average score of user I and user J on all rated items, respectively.Singular value decomposition can be performed offline when used for matrix decomposition calculation and can be well combined with collaborative filtering technology to facilitate the discovery of the characteristics of users and items and make recommendations on this basis. In an actual recommendation system, massive user and item data usually lead to very complicated prediction models. At the same time, due to the existence of a large number of missing scores, the prediction results are often not satisfactory. And through dimensionality reduction, data density can be improved, the problem of data sparseness can be better solved, and the hidden information of the data can be found at the same time. The collaborative filtering algorithm based on singular value decomposition has good applicability. For each item, its characteristics can be composed of different dimensions with different proportions; similarly, for each user, different dimensions can also be divided into different dimensions according to user interests. Different proportions are expressed, and finally the user’s rating of the item can be obtained according to the cross product of the user feature vector and the item feature vector. Based on these advantages of theK-means algorithm, it has also been widely used in collaborative filtering. Its improved collaborative filtering algorithm process is shown in Algorithm 1.Algorithm 1:K-means improved collaborative filtering algorithm.
Input: scoring matrix ROutput: Top-N recommendation collectionStep:(1)
Use the I-means algorithm to cluster the rating matrix R, divide users into m clusters, and use Pearson correlation or cosine similarity as the distance function;(2)
For the currently active usern, calculate the distance between it and m class centers and specify m as the cluster closest to the class center;(3)
Calculate sim (n,v) in the cluster to which user n belongs, and select the k most similar users as the nearest neighbors of n;(4)
According to the rating data of the nearest neighbor user set, weighted prediction of the unrated item rating of the current usern.(5)
Select the Top-N output of the predicted score.Based on the previous discussion, the improved collaborative filtering algorithm is described as follows:(i)
Step 1. Preprocess user data and personalized music data. With the help of tools, keywords are extracted and filtered from the personalized music profile information, and the results are put into the key word information table of personalized music, and then, the personalized music data are clustered according to thek-means clustering algorithm. For user data, fill the user’s dynamic information table based on own user information such as professions, hobbies, and borrowing records.(ii)
Step 2. According to the characteristics of personalized music in personalized music halls in universities and the user’s visit history, use association rules to create a matching tree in each cluster.(iii)
Step 3. According to the user’s fixed information table and dynamic information table, calculate the attribute similarity and active similarity of the target user and other users. According to the calculated user similarity ranking from high to low, the top 5 users are selected as the set of similar users.(iv)
Step 4. Query the borrowing history of each user in the similar user set, find the union S, and remove the personalized music that the user has borrowed. If S is not empty, enter Step 6; otherwise, enter Step 5.(v)
Step 5. Calculate the similarity between the user and the central element of each cluster group, associate the user with a cluster group, and then use the similarity calculation method between the user and the item to calculate the candidate recommendation set Bo.(vi)
Step 6. Use the matching tree to filter the results in the S set or the B set, and the personalized music that can meet the conditions of the matching tree is first put into the final personalized music recommendation set R. If R is empty, put the first 5 items in the S set or B set into the recommended set R.(vii)
Step 7. Recommend the relevant data of the recommendation set R to the user.


## 4. Example Verification

Matlab is used as the simulation environment, and the web crawler program is implemented based on the Matlab simulation environment, and the properties of music files on Youku are captured as a test resource collection, combined with the user context information of the client, to realize the content-based recommendation algorithm, and on this basis, the collection server. The program list of the terminal and the user’s request history information are used as input to calculate the popularity prediction value. Finally, the user’s environmental context information is collected, using Weka for naive Bayes classification and generating a resource recommendation set. This article uses a commonly used recommendation system measurement indicators: recommendation success rate and user satisfaction are used as measurement standards to evaluate the performance of MRAPP (Media Recommendation Algorithm based on Popularity Prediction) algorithm and traditional content-based recommendation technology. The simulation results show that the personalized music recommendation algorithm based on popularity prediction has a good recommendation success rate and high user satisfaction. When verifying the performance of the algorithm, the MovieLens data set is selected as the test data. A data set containing 6050 users’ ratings on 3950 different movies was selected, and 200 users were randomly selected for model performance testing. 80% of the scores are used for training, and the remaining 20% are used for testing. For example, a user rated 30 movies, and then, 24 movies are used to train the model, and the remaining 6 movies are used to test the performance of the model. Although only 200 users were selected in the modeling data, their neighbor users were searched on the entire user data set.First of all, whether the user will watch the recommendation list returned by the recommendation system is a factor to measure the success of the recommendation system. Therefore, the success rate is used to represent the probability that the user selects the resource within a given time when the system returns the firstk recommended resources. This article compares the difference between the recommendation success rate of MRAPP algorithm and content-based recommendation technology when the number of recommended resources increases from 14 to 30, as shown in Figure 4.Figure 4
Comparison of recommendation success rate.It can be seen from Figure4 that as the number of system recommended resources increases, the success rate increases. When k is less than 20, the difference between the MRAPP algorithm and the CB algorithm recommendation success rate is small, and because the personalized music user context information is introduced on the basis of the current user context information, the MRAPP algorithm can provide users with recommended new points of interest. Therefore, when k is greater than 20, the MRAPP algorithm is significantly better than the CB algorithm. When k is greater than 30, the user has a negative psychology for excessive recommended resources and is not considered. Therefore, it can be known from the simulation experiment that the MRAPP algorithm has a good recommendation success rate when the number of recommended resources is between 20 and 30.After filling the original scoring matrix with singular value decomposition prediction, users can be clustered. Figure5 records the impact of different cluster numbers on the recommended accuracy evaluation criterion MAE. When the size of the neighbor set is 18–20, the performance of the collaborative recommendation algorithm is the best. Therefore, we test the MAE value of different cluster numbers when the neighbor set is 18. As can be seen from Figure 5, for the experimental data, the optimal number of clusters, c, should be between 18 and 20, and we might as well as set c = 18 in future experiments. It should be noted that, in this algorithm, the singular value decomposition step and the clustering step are executed in an independent order, so there is no problem of parallel optimization of singular value decomposition to reduce the dimensionality k and the number of clusters c.Figure 5
Comparison of recommended performance of different cluster numbers.Next, in order to verify the performance of the algorithm proposed in this chapter, the traditional collaborative filtering based on Pearson correlation, collaborative filtering based on singular value decomposition (dimensionality retention 14), and collaborative filtering based onK-means (number of clusters 16), comparing with the algorithm proposed in this chapter, on the test data set, the performance of these four methods on different numbers of neighbors is shown in Figures 6 and 7.Figure 6
MAE comparison of different collaborative filtering algorithms.Figure 7
Precision comparison of different collaborative filtering algorithms.It can be seen from Figure6 that the algorithm proposed in this chapter is better than the traditional Pearson collaborative filtering and K-means algorithm in terms of MAE performance. When the number of neighbors exceeds 20, the performance of the algorithm is also better than that based on singular value decomposition. In collaborative filtering, as can be seen from Figure 7, the accuracy of the algorithm is proposed in this chapter (precision performance is better than Pearson and K-means algorithms, and when the number of neighbors is more than 28, the performance of the algorithm is better than that based on singular value decomposition). It can be seen that the K-means collaborative filtering algorithm based on singular value decomposition proposed in this chapter has obtained good prediction accuracy while retaining the good scalability of clustering.In the second stage of this experiment, we also introduced a clustering algorithm to user data. First, users are clustered according to their attribute data so that users with similar interests are gathered into the same group and then filtered from all data sets with the current group user-related records and finally process through matching tree to obtain frequent item sets, namely, strong association rules. The first 10 strong association rules are shown in Figure8. From the data point of view, the results after clustering processing are relatively ideal. The confidence of association rules has been greatly improved.Figure 8
Strong association rules after clustering.Through the above experiments, we can see that the idea of adding association rules to the collaborative filtering algorithm can greatly improve the accuracy of the recommendation, and it is also necessary to cluster the data before the association rule calculation, which improves not only the efficiency of the algorithm but also the confidence of the association rules, thereby improving the accuracy of the algorithm. Analyze the reasons mainly because the readers of university libraries have obvious professional boundaries and interest boundaries. When all data are processed by matching tree, the confidence is often not high. After clustering users, similar users are classified into the same category, and then, only the data related to the users of this category are processed with the matching tree, and the confidence is significantly improved. Use the naive Bayes classifier to classify the environment context, calculate the recommendation probability of media resources, and select Top-k resources with higher recommendation probability, select the appropriate display format for the user’s device context information, and finally, present it to digital home users. The algorithm is simulated by simulation tools, and the simulation results of MRAPP algorithm and CB algorithm are analyzed and compared, which shows that MRAPP has good performance in terms of recommendation accuracy and user satisfaction.


## 5. Conclusion

According to the research environment of personalized music recommendation, the user’s context information is classified and modeled, and the traditional content-based recommendation technology is used to aggregate user preference context for recommendation; then, the content-based recommendation technology cannot recommend new points of interest for users and further combine context information, introduce the concept of popularity, calculate the popularity prediction value of media resources through multiple linear regression according to the historical visit records of media users, and use it for further screening the client recommended resource collection; finally, in order to integrate the environment context information, use the naive Bayes classifier to classify the environment context, calculate the recommendation probability of media resources, select Top-k resources with a higher recommendation probability, select the appropriate display format for the user’s device context information, and finally, present to the personalized music recommendation users. The algorithm is simulated by simulation tools, and the simulation results of MRAPP algorithm and CB algorithm are analyzed and compared, which shows that MRAPP has good performance in terms of recommendation accuracy and user satisfaction. Class methods have the advantages of good real-time performance and strong scalability. The experimental results show that compared with the traditional Pearson collaborative filtering, based on singular value decomposition collaborative filtering and K-means based collaborative filtering, this algorithm has better prediction performance and good scalability.



---

*Source: 6643888-2020-12-18.xml*