Skip to content

Commit

Permalink
refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
tqtg committed Aug 11, 2023
1 parent 7177a31 commit 3a1f0ce
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cornac/eval_methods/base_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,9 @@ def pos_items(csr_row):

# filter items being considered for evaluation
if exclude_unknowns:
item_indices = np.arange(train_set.num_items)
u_gt_pos_mask = u_gt_pos_mask[: train_set.num_items]
u_gt_neg_mask = u_gt_neg_mask[: train_set.num_items]
else:
item_indices = np.arange(test_set.num_items)

item_indices = np.nonzero(u_gt_pos_mask + u_gt_neg_mask)[0]
u_gt_pos_items = np.nonzero(u_gt_pos_mask)[0]
u_gt_neg_items = np.nonzero(u_gt_neg_mask)[0]
Expand Down

0 comments on commit 3a1f0ce

Please sign in to comment.