Learning to Recommend via Inverse Optimal Matching