train_test_split_no_unseen

KGE.data_utils.train_test_split_no_unseen(X, test_size, seed)[source]

Split KG data into train and test

Split KG data into train and test, this function guarantees that the entities in test data are also present in the train data.

Parameters
  • X (np.array) – KG data to be splitted

  • test_size (int or float) – desired test size, if int, represents the absolute test size, if float, represents the relative proportion.

  • seed (int) – random seed

Returns

splitted train, test KG data

Return type

np.array, np.array