Research Article

Personalized Music Recommendation Simulation Based on Improved Collaborative Filtering Algorithm

Algorithm 1

K-means improved collaborative filtering algorithm.
 Input: scoring matrix R
 Output: Top-N recommendation collection
 Step:
(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 user n, calculate the distance between it and m class centers and specify m as the cluster closest to the class center;
(3)Calculate sim (n,) 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 user n.
(5)Select the Top-N output of the predicted score.