popularity-based recommendation engine the simplest recommendation engine is naturally the easiest to develop as we can easily develop recommendation enginesthis type of recommendation engine is very straightforward one to develop the driving logic of this recommendation engine is that if some item is liked (or listened toby vast majority of our user basethen it is good idea to recommend that item to users who have not interacted with that item the code to develop this kind of recommendation is extremely easy and is effectively just summarization procedure to develop these recommendationswe will determine which songs in our dataset have the most users listening to them and then that will become our standard recommendation set for each user the code that follows defines function that will do this summarization and return the resultant dataframe in [ ]def create_popularity_recommendation(train_datauser_iditem_id)#get count of user_ids for each unique song as recommendation score train_data_grouped train_data groupby([item_id]agg({user_id'count'}reset_index(train_data_grouped rename(columns {user_id'score'},inplace=true#sort the songs based upon recommendation score train_data_sort train_data_grouped sort_values(['score'item_id]ascending [ , ]#generate recommendation rank based upon score train_data_sort['rank'train_data_sort['score'rank(ascending= method='first'#get the top recommendations popularity_recommendations train_data_sort head( return popularity_recommendations in [ ]recommendations create_popularity_recommendation(triplet_dataset_sub_song_ merged,'user','title'in [ ]recommendations we can use this function on our dataset to generate the top recommendations to each of our users the output of our plain vanilla recommendation system is shown in figure - here you can see that the recommendations are very similar to the list of the most popular songs that you saw in the last sectionwhich is expected as the logic behind both is the same--only the output is different