Skip to content

Commit

Permalink
fixed wrong dtypes with nonreindex valset
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cortes committed Sep 24, 2018
1 parent ace949b commit 975df4e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -108,7 +108,7 @@ recommender.partial_fit(counts_df.loc[counts_df.UserId.isin(users_batch2)])
recommender.partial_fit(counts_df.loc[counts_df.UserId.isin(users_batch3)])

## Making predictions
recommender.topN(user=10, n=10, exclude_seen=True)
# recommender.topN(user=10, n=10, exclude_seen=True) ## not available when using 'partial_fit'
recommender.topN(user=10, n=10, exclude_seen=False, items_pool=np.array([1,2,3,4]))
recommender.predict(user=10, item=11)
recommender.predict(user=[10,10,10], item=[1,2,3])
Expand Down
6 changes: 3 additions & 3 deletions hpfrec/__init__.py
Expand Up @@ -525,9 +525,9 @@ def _process_valset(self, val_set, valset=True):
"in common with the training set.")
else:
self.val_set.reset_index(drop=True, inplace=True)
self.val_set['Count'] = self.val_set.Count.astype('float32')
self.val_set['UserId'] = self.val_set.UserId.astype(ctypes.c_int)
self.val_set['ItemId'] = self.val_set.ItemId.astype(ctypes.c_int)
self.val_set['Count'] = self.val_set.Count.astype('float32')
self.val_set['UserId'] = self.val_set.UserId.astype(ctypes.c_int)
self.val_set['ItemId'] = self.val_set.ItemId.astype(ctypes.c_int)
return None

def _store_metadata(self, for_partial_fit=False):
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -27,12 +27,12 @@
'scipy',
'cython'
],
version = '0.2.2.2',
version = '0.2.2.3',
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.2.tar.gz',
download_url = 'https://github.com/david-cortes/hpfrec/archive/0.2.2.3.tar.gz',
keywords = ['poisson', 'probabilistic', 'non-negative', 'factorization', 'variational inference', 'collaborative filtering'],
classifiers = [],

Expand Down

0 comments on commit 975df4e

Please sign in to comment.