Skip to content

Commit e7f5794

Browse files
committed
Modify Decision
1 parent bdb04d6 commit e7f5794

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

python/CollaborativeFiltering.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# @Author: WuLC
33
# @Date: 2016-04-12 15:53:02
44
# @Last modified by: WuLC
5-
# @Last Modified time: 2016-04-12 19:42:16
5+
# @Last Modified time: 2016-04-12 20:26:32
66
77
# @Function: implementation of User-based collaborative filetering
88
# @Referer: chaper 2 of the book 《programming-collective-intelligence》
@@ -127,7 +127,7 @@ def user_similarity_on_pearson(scores, user1, user2):
127127
return modified_cosine_similarity
128128

129129

130-
def find_similar_users(scores,user,similar_function = user_similarity_on_cosine):
130+
def find_similar_users(scores,user,similar_function = user_similarity_on_modified_cosine):
131131
"""find similar users based on the similar-function defined above
132132
133133
Args:
@@ -178,12 +178,12 @@ def recommend_item(scores,user):
178178

179179

180180
if __name__ == '__main__':
181-
'''
181+
182182
similarList = find_similar_users(critics, 'Lisa Rose')
183183
for i in similarList:
184184
print i
185185
'''
186186
item_score = recommend_item(critics,'Lisa Rose')
187187
for i,j in item_score:
188188
print i,j
189-
189+
'''

python/DecisionTree.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# -*- coding: utf-8 -*-
22
# @Author: LC
33
# @Date: 2016-04-08 15:26:49
4-
# @Last modified by: LC
5-
# @Last Modified time: 2016-04-12 15:50:47
4+
# @Last modified by: WuLC
5+
# @Last Modified time: 2016-04-12 20:29:36
66
77
# @Function:implementation of decision tree described in programming-collective-intelligence in chapter 7
88
# @Referer: chapter 7 in book 《programming-collective-intelligence》
@@ -35,7 +35,6 @@ def __init__(self, col=-1, value=None, results=None, tb=None, fb=None):
3535

3636

3737
def divid_set(rows, col, value):
38-
3938
"""divide the rows into two set according to the value of column col
4039
4140
Args:

0 commit comments

Comments
 (0)