Skip to content

Commit

Permalink
implicit algo attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
mdekstrand committed Nov 28, 2018
1 parent 16d72f8 commit ccd8e29
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lenskit/algorithms/implicit.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ def recommend(self, model: ImplicitModel, user, n=None, candidates=None, ratings
rec_df['item'] = model.items[rec_df.item_pos]
return rec_df.loc[:, ['item', 'score']]

def __getattr__(self, name):
return self.algo_kwargs[name]

def __str__(self):
return 'Implicit({}, {}, {})'.format(self.algo_class.__name__, self.algo_args, self.algo_kwargs)

class ALS(BaseRec):
"""
Expand Down

0 comments on commit ccd8e29

Please sign in to comment.