This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get the data here http://grouplens.org/datasets/movielens/ | |
movielens = sc.textFile("../in/ml-100k/u.data") | |
movielens.first() #u'196\t242\t3\t881250949' | |
movielens.count() #100000 | |
#Clean up the data by splitting it | |
#Movielens readme says the data is split by tabs and | |
#is user product rating timestamp | |
clean_data = movielens.map(lambda x:x.split('\t')) |