Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
sonali9696 authored Apr 4, 2017
1 parent 1499d7d commit ff6c235
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion movieRatings_UI_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,14 @@ def recommenderSystem(self):
'Film-Noir', 'Horror', 'Musical', 'Mystery', 'Romance', 'Sci-Fi', 'Thriller', 'War', 'Western']
items = pd.read_csv('ml-100k/u.item', sep='|', names=i_cols,encoding='latin-1')
ind = np.argpartition(predictions_for_newuser, -1)[-5:]
for i in range(len(ind)):

ind2 = self.ratings_data['2movie_id'][0]
#print items['movie title'][ind2]
d = { 'movie_title': [ items['movie title'][ind2] ] }
df = pd.DataFrame(d)
df.to_csv('movie_reco.data' ,sep='\t',index=False, header=False)

for i in range(1,len(ind)):
ind2 = self.ratings_data['2movie_id'][i]
#print items['movie title'][ind2]
d = { 'movie_title': [ items['movie title'][ind2] ] }
Expand Down

0 comments on commit ff6c235

Please sign in to comment.