Skip to content

Commit

Permalink
- Fix bug in base knn
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfortes committed May 27, 2017
1 parent b904b13 commit c688514
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions caserec/recommenders/rating_prediction/base_knn.py
Expand Up @@ -62,6 +62,7 @@ def compute_bi(self):

for item in self.train['items']:
cont = 0
# self.bi.update({item: 0})
for user in self.train['di'][item]:
self.bi[item] = self.bi.get(item, 0) + float(self.train['feedback'][user].get(item, 0)) - \
self.train['mean_rates'] - self.bu.get(user, 0)
Expand Down
2 changes: 1 addition & 1 deletion caserec/utils/read_file.py
Expand Up @@ -121,7 +121,7 @@ def return_information(self, implicit=False):
matrix[map_user[user]][map_item[item]] = 1
else:
matrix[map_user[user]][map_item[item]] = d_feedback[user][item]
self.dict_items.setdefault(map_item[item], set()).add(map_user[user])
# self.dict_items.setdefault(map_item[item], set()).add(map_user[user])

sparsity = (1 - (self.number_interactions / float(len(self.list_users) * len(self.list_items)))) * 100
dict_file.update({'feedback': d_feedback, 'users': self.list_users, 'items': self.list_items,
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -6,13 +6,13 @@
setup(
name='CaseRecommender',
packages=find_packages(),
version='0.0.15',
version='0.0.16',
license='GPL3 License',
description='A recommender systems framework for Python',
author='Arthur Fortes',
author_email='fortes.arthur@gmail.com',
url='https://github.com/ArthurFortes/CaseRecommender',
download_url='https://github.com/ArthurFortes/CaseRecommender/tarball/0.0.15',
download_url='https://github.com/ArthurFortes/CaseRecommender/tarball/0.0.16',
keywords=['recommender systems', 'framework', 'collaborative filtering', 'content-based filtering'],
classifiers=[],
)

0 comments on commit c688514

Please sign in to comment.