Skip to content

Commit

Permalink
bugfixes fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cortes committed Sep 24, 2018
1 parent 79e999c commit ace949b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hpfrec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ def _process_data_single(self, counts_df):
if self.reindex:
if self.produce_dicts:
try:
counts_df['ItemId'] = counts_df.ItemId.map(lambda x: self.item_dict_[user])
counts_df['ItemId'] = counts_df.ItemId.map(lambda x: self.item_dict_[x])
except:
raise ValueError("Can only make calculations for items that were in the training set.")
else:
Expand Down Expand Up @@ -1046,7 +1046,7 @@ def add_user(self, user_id, counts_df, update_existing=False, maxiter=10, ncores
if update_existing:
## checking that the user already exists
if self.produce_dicts and self.reindex:
user_id = self.user_dict_[user]
user_id = self.user_dict_[user_id]
else:
if self.reindex:
user_id = pd.Categorical(np.array([user_id]), self.user_mapping_).codes[0]
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
'scipy',
'cython'
],
version = '0.2.2.1',
version = '0.2.2.2',
description = 'Hierarchical Poisson matrix factorization for recommender systems',
author = 'David Cortes',
author_email = 'david.cortes.rivera@gmail.com',
url = 'https://github.com/david-cortes/hpfrec',
download_url = 'https://github.com/david-cortes/hpfrec/archive/0.2.2.1.tar.gz',
download_url = 'https://github.com/david-cortes/hpfrec/archive/0.2.2.2.tar.gz',
keywords = ['poisson', 'probabilistic', 'non-negative', 'factorization', 'variational inference', 'collaborative filtering'],
classifiers = [],

Expand Down

0 comments on commit ace949b

Please sign in to comment.