I have a dataset in the form of a userID, itemID ratings matrix that I am trying to convert to the form {userID, itemID, rating} for use with the Mahout item-based recommender, as described here: https://mahout.apache.org/users/recommender/userbased-5-minutes.html#dataset.
In other words, I want to convert something like this:
1 2 3
1 1.0 2.0 3.0
2 4.0 5.0 6.0
3 7.0 8.0 9.0
Into something like this:
1,1,1.0
1,2,2.0
1,3,3.0
2,1,4.0
2,2,5.0
2,3,6.0
3,1,7.0
3,2,8.0
3,3,9.0
Is there a way to accomplish this using Apache Hadoop tools (Pig, Hive, etc.)?