def read_data(sc,
	data_file,
	delimiter='::'):
	"""
	Read the data into an RDD of tuple (usrId, productId, rating).
	Args:
		sc: An active SparkContext.
		data_file: A (delimiter) separated file.
		delimiter: The delimiter used to separate the 3 fields of the input file. Default is ','.
	Returns:
		ui_mat_rdd: The UI matrix in an RDD.
	"""

	data = sc.textFile(data_file)
	header = data.first()
	ui_mat_rdd = data.filter(lambda row: row != header) \
		.map(lambda x: (int(x.split(delimiter)[0]),int(x.split(delimiter)[1]),float(x.split(delimiter)[2])))

	return ui_mat_rdd