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
making_recommendation [2016/05/17 06:37] hkimscilmaking_recommendation [2017/03/13 12:55] (current) hkimscil
Line 1: Line 1:
-{{:class:swap:recommendations_toby.pdf|Reading material}}+{{c:swap:recommendations_toby.pdf|Reading material}} 
 +{{0y100685.pdf|상관관계를 이용한 recommendation system 예}}
 Python 실행 Python 실행
 <code py>c:\code\collective\chapter2> python <code py>c:\code\collective\chapter2> python
Line 74: Line 75:
 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 82:
 </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 128:
  
 <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 148:
  
 <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 197:
  
 <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 360:
     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.1463436442.txt.gz · Last modified: 2016/05/17 06:37 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki