User Tools

Site Tools


making_recommendation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
making_recommendation [2016/05/17 06:37] hkimscilmaking_recommendation [2016/05/17 07:00] hkimscil
Line 74: Line 74:
 similarity between two users. similarity between two users.
  
 +__for python 2.x__
 <code>>>> import(recommendations)  <code>>>> import(recommendations) 
 >>> # reload(recommendations) >>> # reload(recommendations)
Line 81: Line 81:
 </code> </code>
  
-for python 3.xx+//for python 3.xx//
 <code>>>> import recommendations <code>>>> import recommendations
 imp.reload(recommendations) imp.reload(recommendations)
Line 127: Line 127:
  
 <code>>>> reload(recommendations) <code>>>> reload(recommendations)
->>> print recommendations.sim_pearson(recommendations.critics, +>>> print recommendations.sim_pearson(recommendations.critics,'Lisa Rose','Gene Seymour') 
-... 'Lisa Rose','Gene Seymour')+>>> # for python 3.4 아랫줄로 대체해서 사용할 것 
 +>>> print (recommendations.sim_pearson(recommendations.critics,'Lisa Rose','Gene Seymour'))
 0.396059017191 0.396059017191
 </code> </code>
Line 146: Line 147:
  
 <code>>> reload(recommendations) <code>>> reload(recommendations)
->> recommendations.topMatches(recommendations.critics,'Toby',n=3) +>> recommendations.topMatches(recommendations.critics,'Toby',n=3)  
-[(0.99124070716192991, 'Lisa Rose'), (0.92447345164190486, 'Mick LaSalle'), +[(0.99124070716192991, 'Lisa Rose'), (0.92447345164190486, 'Mick  
-(0.89340514744156474, 'Claudia Puig')]+LaSalle'), (0.89340514744156474, 'Claudia Puig')]
 </code> </code>
- 
- 
  
 ^ Critic  ^ Similarity  ^ Night  ^ S.xNight  ^ Lady  ^ S.xLady  ^ Luck  ^ S.xLuck  ^ ^ Critic  ^ Similarity  ^ Night  ^ S.xNight  ^ Lady  ^ S.xLady  ^ Luck  ^ S.xLuck  ^
Line 197: Line 196:
  
 <code>>>> reload(recommendations) <code>>>> reload(recommendations)
->>> recommendations.getRecommendations(recommendations.critics,'Toby'+>>> recommendations.getRecommendations(recommendations.critics,'Toby')  
-[(3.3477895267131013, 'The Night Listener'), (2.8325499182641614, 'Lady in the +[(3.3477895267131013, 'The Night Listener'), (2.8325499182641614, 'Lady in the Water'), (2.5309807037655645, 'Just My Luck')] 
-Water'), (2.5309807037655645, 'Just My Luck')] +>>> recommendations.getRecommendations(recommendations.critics,'Toby', similarity=recommendations.sim_distance)  
->>> recommendations.getRecommendations(recommendations.critics,'Toby', +[(3.5002478401415877, 'The Night Listener'), (2.7561242939959363, 'Lady in the Water'), (2.4619884860743739, 'Just My Luck')] 
-... similarity=recommendations.sim_distance) +
-[(3.5002478401415877, 'The Night Listener'), (2.7561242939959363, 'Lady in the +
-Water'), (2.4619884860743739, 'Just My Luck')]+
 </code> </code>
  
Line 363: Line 359:
     c+=1     c+=1
     if c%100==0: print "%d / %d" % (c,len(itemPrefs))     if c%100==0: print "%d / %d" % (c,len(itemPrefs))
 +    # for python3.4 윗줄을 아랫줄로 대체
 +    # if c%100==0: print ("%d / %d" % (c,len(itemPrefs)))
     # Find the most similar items to this one     # Find the most similar items to this one
     scores=topMatches(itemPrefs,item,n=n,similarity=sim_distance)     scores=topMatches(itemPrefs,item,n=n,similarity=sim_distance)
making_recommendation.txt · Last modified: 2017/03/13 12:55 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki