I have a Recommender system which uses a Collaborative bayesian approach using pSDAE for recommending scientific articles from the Citeulike Dataset
The text information (as input to pSDAE) is in the file mult.dat and the rating matrix (as input for the MF part) is in the file cf-train-1-users.dat and is loaded using the following code:
def get_mult():
X = read_mult('mult.dat',8000).astype(np.float32)
return X
def read_user(f_in='cf-train-1-users.dat',num_u=5551,num_v=16980):
fp = open(f_in)
R = np.mat(np.zeros((num_u,num_v)))
for i,line in enumerate(fp):
segs = line.strip().split(' ')[1:]
for seg in segs:
R[i,int(seg)] = 1
return R
The raw data is in proper Excel format with citations as doc-id, title, citeulike-id, raw-title, raw-abstract.
The mult.dat file containing hte text information looks like:
63 1:2 1666:1 132:1 901:1 1537:2 8:1 9:1 912:1
The trainusers.dat file looks like:
10 1631 3591 10272 14851 4662 13172 12684 5324 3595 3404
Here is the link to th ipynb for the whole Recommender system:
https://github.com/js05212/MXNet-for-CDL/blob/master/collaborative-dl.ipynb