The following mapper and reducer were submitted as an assignment for a Big Data: High-Performance Computing class offered through the M.S. Data Science program at the University of Wisconsin-Eau Claire.
A MapReduce Python program for recommending products with respect to items in a shopper's cart.
The number appearing to the left of the : is the product ID in question and considered to be in a shoppers cart. Numbers to the right of the : and left of the ! are products favored to be paired with the product in question, while numbers to the right of the : and right of the ! are products not favored to be paired with the product in question.