determine the songs listened to by the user calculate the similarity of each song in the user' list to those in our datasetusing the similarity metric defined previously determine the songs that are most similar to the songs already listened to by the user select subset of these songs as recommendation based on the similarity score as the step can become computation-intensive step when we have large number of songswe will subset our data to , songs to make the computation more feasible we will select the most popular , songs so it is quite unlikely that we would miss out on any important recommendations in [ ]song_count_subset song_count_df head( = user_subset list(play_count_subset usersong_subset list(song_count_subset songtriplet_dataset_sub_song_merged_sub triplet_dataset_sub_song_merged[triplet_dataset_sub_ song_merged song isin(song_subset)this code will subset our dataset to contain only most popular , songs we will then create our similarity based recommendation engine and generate recommendation for random user we leverage siraj' recommenders module here for the item similarity based recommendation system in [ ]train_datatest_data train_test_split(triplet_dataset_sub_song_merged_subtest_size random_state= is_model recommenders item_similarity_recommender_py(is_model create(train_data'user''title'user_id list(train_data user)[ user_items is_model get_user_items(user_idis_model recommend(user_idthe recommendations for random users are shown in figure - notice the stark difference from the popularity based recommendation engine so this particular person is almost guaranteed to not like the most popular songs in our dataset