Permalink
Browse files

change the reindex function, only take one input

  • Loading branch information...
1 parent bd6db7e commit 23279c14de35aedb3ee2b7b767b1c0419ca2927c @Ykid Ykid committed Aug 1, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 utils/ImplicitFeedbackFunctions.py
@@ -1,8 +1,8 @@
import sys
-def reIndex_Implicit(fin, fout):
- print("Reindexing Training Set and Buiding the Correspondence Dics")
+def reIndex_Implicit(fin):#, fout):
+ print("Reindexing Origin Data Set and Buiding the Correspondence Dics")
fi = open( fin, 'r' ) #training set
- fo = open( fout, 'w') #reindexed training set
+ #fo = open( fout, 'w') #reindexed training set
#extract from input file
uidDic={}
iidDic={}
@@ -29,8 +29,8 @@ def reIndex_Implicit(fin, fout):
iidDic[iid]=newiid
newiid+=1
- fo.write('%d\t%d\t%d\n' %(uidDic[uid],iidDic[iid],rating))
- fo.close()
+ # fo.write('%d\t%d\t%d\n' %(uidDic[uid],iidDic[iid],rating))
+ #fo.close()
fi.close()
#calculate different parameter.
avg=sum/ctr

0 comments on commit 23279c1

Please sign in to comment.