do precision calculation for top recommendations in python