Example code for backtesting a recommendation model