train_test_split_no_unseen

ampligraph.evaluation.train_test_split_no_unseen(X, test_size=5000, seed=0)

Split into train and test sets.

Test set contains only entities and relations which also occur in the training set.
Parameters:
  • X (ndarray, size[n, 3]) – The dataset to split.
  • test_size (int, float) – If int, the number of triples in the test set. If float, the percentage of total triples.
  • seed (int) – A random seed used to split the dataset.
Returns:

  • X_train (ndarray, size[n, 3]) – The training set
  • X_test (ndarray, size[n, 3]) – The test set