Repository: pykeen/pykeen
Issue: Know the entities in the testing set
Root cause: Documentation Deficiency

### What is your question

Is there function to know what are the testing triplets (not just the embedding ids)  after using  `tf.split()`   because I need to perform other validations on the testing data ? 

### Environment

Key	Value
OS	posix
Platform	Linux
Release	5.10.107+
Time	Wed May 25 08:41:44 2022
Python	3.7.12
PyKEEN	1.8.1
PyKEEN Hash	UNHASHED
PyKEEN Branch	
PyTorch	1.11.0
CUDA Available?	true
CUDA Version	11.0
cuDNN Version	8005


### Issue Template Checks

- [X] This is not a bug report (use a different issue template if it is)
- [X] This is not a feature request (use a different issue template if it is)
- [X] I've read the text explaining why including environment information is important and understand if I omit this information that my issue will be dismissed

The `TriplesFactory` has a method [`label_triples`](https://pykeen.readthedocs.io/en/stable/reference/triples.html#pykeen.triples.TriplesFactory.label_triples) which can convert the ID-based triples back to their labeled format.

If you want to perform your operations on the ID-based triples (which can be faster), you can also convert the entity/relation labels of interest to IDs via [TriplesFactory.entities_to_ids](https://pykeen.readthedocs.io/en/stable/reference/triples.html#pykeen.triples.TriplesFactory.entities_to_ids) or [TriplesFactory.relations_to_ids](https://pykeen.readthedocs.io/en/stable/reference/triples.html#pykeen.triples.TriplesFactory.relations_to_ids).

> The `TriplesFactory` has a method [`label_triples`](https://pykeen.readthedocs.io/en/stable/reference/triples.html#pykeen.triples.TriplesFactory.label_triples) which can convert the ID-based triples back to their labeled format.
> 
> If you want to perform your operations on the ID-based triples (which can be faster), you can also convert the entity/relation labels of interest to IDs via [TriplesFactory.entities_to_ids](https://pykeen.readthedocs.io/en/stable/reference/triples.html#pykeen.triples.TriplesFactory.entities_to_ids) or [TriplesFactory.relations_to_ids](https://pykeen.readthedocs.io/en/stable/reference/triples.html#pykeen.triples.TriplesFactory.relations_to_ids).

Thanks for your quick reply , 
how can I use : 

```
tf = TriplesFactory.from_labeled_triples(modified_dataset.values) 
training,testing = tf.split(random_state=1234) 
testing_label = TriplesFactory.labeled_triples(teating)  # I got an error 
``` 

would be nice if you sent the error messages along with comments, I think it will become obvious from reading it carefully what the issue is

> would be nice if you sent the error messages along with comments, I think it will become obvious from reading it carefully what the issue is

yeah, the error message 

> label_triples() missing 1 required positional argument: 'triples

In general , I want to try something like Mrr and hits@N but on the relations and not just the head or tail. I am not sure if it already available in Pykeen or not 

`label_triples` is a non-static method, so you need to call it from an *instance* of a TriplesFactory, rather than as a class method.

From you example
```python
tf = TriplesFactory.from_labeled_triples(modified_dataset.values) 
training, testing = tf.split(random_state=1234) 
testing_label = TriplesFactory.labeled_triples(teating)  # I got an error 
```
the last line should be
```python
tf = TriplesFactory.from_labeled_triples(modified_dataset.values) 
training, testing = tf.split(random_state=1234) 
testing_label = testing.label_triples(triples=testing.mapped_triples)
```

Regarding

> In general , I want to try something like Mrr and hits@N but on the relations and not just the head or tail. I am not sure if it already available in Pykeen or not

You may want to take a look at the `targets` parameter of [pykeen.evaluation.evaluate](https://pykeen.readthedocs.io/en/stable/api/pykeen.evaluation.evaluate.html#pykeen.evaluation.evaluate), which can be set to `(pykeen.typing.LABEL_RELATION,)`.

There is an issue with passing this through the pipeline, cf. https://github.com/pykeen/pykeen/issues/867, which may be fixed with  #938. Until then, you would need to manually call the `evaluate` function.

> Regarding
> 
> > In general , I want to try something like Mrr and hits@N but on the relations and not just the head or tail. I am not sure if it already available in Pykeen or not
> 
> You may want to take a look at the `targets` parameter of [pykeen.evaluation.evaluate](https://pykeen.readthedocs.io/en/stable/api/pykeen.evaluation.evaluate.html#pykeen.evaluation.evaluate), which can be set to `(pykeen.typing.LABEL_RELATION,)`.
> 
> There is an issue with passing this through the pipeline, cf. #867, which may be fixed with #938. Until then, you would need to manually call the `evaluate` function.

Great, thanks