diff --git a/cornac/models/comparer/recom_comparer_obj.pyx b/cornac/models/comparer/recom_comparer_obj.pyx index 1c522b6f..3c2162a2 100644 --- a/cornac/models/comparer/recom_comparer_obj.pyx +++ b/cornac/models/comparer/recom_comparer_obj.pyx @@ -663,7 +663,7 @@ class ComparERObj(Recommender): item_score = self.U2[item_id, :].dot(self.U1[user_id, :]) + self.H2[item_id, :].dot(self.H1[user_id, :]) return item_score - def rank(self, user_id, item_ids=None): + def rank(self, user_id, item_ids=None, k=None): """Rank all test items for a given user. Parameters diff --git a/cornac/models/comparer/recom_comparer_sub.pyx b/cornac/models/comparer/recom_comparer_sub.pyx index e1eec1c7..69dad58e 100644 --- a/cornac/models/comparer/recom_comparer_sub.pyx +++ b/cornac/models/comparer/recom_comparer_sub.pyx @@ -759,7 +759,7 @@ class ComparERSub(MTER): return correct, skipped, loss, bpr_loss - def rank(self, user_idx, item_indices=None): + def rank(self, user_idx, item_indices=None, k=None): if self.alpha > 0 and self.n_top_aspects > 0: n_top_aspects = min(self.n_top_aspects, self.num_aspects) ts1 = np.einsum("abc,a->bc", self.G1, self.U[user_idx]) diff --git a/cornac/models/efm/recom_efm.pyx b/cornac/models/efm/recom_efm.pyx index 5d6dd582..b0dc140e 100644 --- a/cornac/models/efm/recom_efm.pyx +++ b/cornac/models/efm/recom_efm.pyx @@ -468,7 +468,7 @@ class EFM(Recommender): item_score = self.U2[item_idx, :].dot(self.U1[user_idx, :]) + self.H2[item_idx, :].dot(self.H1[user_idx, :]) return item_score - def rank(self, user_idx, item_indices=None): + def rank(self, user_idx, item_indices=None, k=None): """Rank all test items for a given user. Parameters diff --git a/cornac/models/lrppm/recom_lrppm.pyx b/cornac/models/lrppm/recom_lrppm.pyx index 2c8ec547..3a2c9884 100644 --- a/cornac/models/lrppm/recom_lrppm.pyx +++ b/cornac/models/lrppm/recom_lrppm.pyx @@ -516,7 +516,7 @@ class LRPPM(Recommender): item_score = self.I[i_idx].dot(self.U[u_idx]) return item_score - def rank(self, user_idx, item_indices=None): + def rank(self, user_idx, item_indices=None, k=None): if self.alpha > 0 and self.num_top_aspects > 0: n_items = self.num_items num_top_aspects = min(self.num_top_aspects, self.num_aspects)