get_not_seen_mask

rectools.model_selection.utils.get_not_seen_mask(train_users: ndarray, train_items: ndarray, test_users: ndarray, test_items: ndarray) ndarray[source]

Return mask for test interactions that is not in train interactions.

Parameters
  • train_users (np.ndarray) – Integer array of users in train interactions (it’s not a unique users!).

  • train_items (np.ndarray) – Integer array of items in train interactions. Has same length as train_users.

  • test_users (np.ndarray) – Integer array of users in test interactions (it’s not a unique users!).

  • test_items (np.ndarray) – Integer array of items in test interactions. Has same length as test_users.

Returns

Boolean mask of same length as test_users (test_items). True means interaction not present in train.

Return type

np.ndarray