I am building a Recommender System where I am giving the User 3 Recommendations depending upon for the Webpage he is on. Let's say My model gives me 3 Recommendations from 2020, 2019, 2015. I would first recommend the User the 2020 article and so on. Currently what I am doing is just filtering the JSON Recommendations from my Dataframe as the Latest articles. Is there any Scalable and efficient way to do this.


output_df['latest'] = output_df['recommendations'].apply(lambda x : sorted([(value,key) for key,value in x.items()], key=lambda x:x[1]))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.