Repository: pykeen/pykeen
Issue: restrict_relations_to or restrict_entities_to give error
Root cause: Validation Gap

### Describe the bug

Hello, 

Thanks for your huge work on pykeen. I want to signal an unexpected error that i got by using `restrict_relations_to` or `restrict_entities_to` in my evaluation function (i know i can use pipeline and give a whitelist of entities or relations). But i'm trying to implement my code in the detailed way. 

### How to reproduce

``` python

# Get a training dataset
from pykeen.datasets import Nations


dataset = Nations()
training_triples_factory = dataset.training

# Pick a model
from pykeen.models import TransE

model = TransE(triples_factory=training_triples_factory)

# Pick an optimizer from Torch
from torch.optim import Adam

optimizer = Adam(params=model.get_grad_params())

# Pick a training approach (sLCWA or LCWA)
from pykeen.training import SLCWATrainingLoop

training_loop = SLCWATrainingLoop(
    model=model,
    triples_factory=training_triples_factory,
    optimizer=optimizer,
)

# Train like Cristiano Ronaldo
_ = training_loop.train(
    triples_factory=training_triples_factory,
    num_epochs=5,
    batch_size=256,
)

# Pick an evaluator
from pykeen.evaluation import RankBasedEvaluator, ClassificationEvaluator
evaluator = ClassificationEvaluator()

# Get triples to test
mapped_triples = dataset.testing.mapped_triples

# Evaluate
results = evaluator.evaluate(
    model=model,
    mapped_triples=mapped_triples,
    batch_size=1024,
    additional_filter_triples=[
        dataset.training.mapped_triples,
        dataset.validation.mapped_triples,
    ],
    restrict_relations_to={1,5},
    pre_filtered_triples=False,
)
print(results.get_metric("accuracy_score"))
```

### Environment

| Key             | Value                    |
|-----------------|--------------------------|
| OS              | posix                    |
| Platform        | Linux                    |
| Release         | 5.15.0-69-generic        |
| Time            | Tue Apr  4 13:34:33 2023 |
| Python          | 3.10.6                   |
| PyKEEN          | 1.10.1                   |
| PyKEEN Hash     | UNHASHED                 |
| PyKEEN Branch   |                          |
| PyTorch         | 2.0.0+cu117              |
| CUDA Available? | false                    |
| CUDA Version    | 11.7                     |
| cuDNN Version   | 8500                     |


### Additional information

_No response_

### Issue Template Checks

- [X] This is not a feature request (use a different issue template if it is)
- [X] This is not a question (use the [discussions](https://github.com/pykeen/pykeen/discussions/new) forum instead)
- [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

i will close it, i remark that for certains ID i have not got the error, so could some one explain me why for some id it works and won't for other. 
Thanks 

>  I want to signal an unexpected error that i got by using restrict_relations_to or restrict_entities_to in my evaluation function

It would be quite helpful to see the error message and traceback 😉 

This is the error that i got, but when i choose another relation ID like 8 for example it does not make this error. I conclude that it is probably linked to the filter apply before evaluting ? 
Am I wrong ? But i cannot explain in deph, any explanation are welcome. Thank you

```

ValueError                                Traceback (most recent call last)
Cell In[1], line 42
     39 mapped_triples = dataset.testing.mapped_triples
     41 # Evaluate
---> 42 results = evaluator.evaluate(
     43     model=model,
     44     mapped_triples=mapped_triples,
     45     batch_size=1024,
     46     additional_filter_triples=[
     47         dataset.training.mapped_triples,
     48         dataset.validation.mapped_triples,
     49     ],
     50     restrict_relations_to={1},
     51     pre_filtered_triples=False,
     52 )
     53 print(results.get_metric("accuracy_score"))

File /srv/scratch/gaoussou/MyEnvVariables/PykeenEnv/lib/python3.10/site-packages/pykeen/evaluation/evaluator.py:213, in Evaluator.evaluate(self, model, mapped_triples, batch_size, slice_size, **kwargs)
    210         # Clear the ranks from the current evaluator
    211         self.clear()
--> 213 rv = evaluate(
    214     model=model,
    215     mapped_triples=mapped_triples,
    216     evaluator=self,
    217     batch_size=batch_size,
    218     slice_size=slice_size,
    219     **kwargs,
    220 )
    221 # Since squeeze is true, we can expect that evaluate returns a MetricResult, but we need to tell MyPy that
    222 return cast(MetricResults, rv)

File /srv/scratch/gaoussou/MyEnvVariables/PykeenEnv/lib/python3.10/site-packages/pykeen/evaluation/evaluator.py:709, in evaluate(model, mapped_triples, evaluator, only_size_probing, batch_size, slice_size, device, use_tqdm, tqdm_kwargs, restrict_entities_to, restrict_relations_to, do_time_consuming_checks, additional_filter_triples, pre_filtered_triples, targets, mode)
    706             progress_bar.update(batch_size)
    708     # Finalize
--> 709     result = evaluator.finalize()
    711 stop = timeit.default_timer()
    712 if only_size_probing:

File /srv/scratch/gaoussou/MyEnvVariables/PykeenEnv/lib/python3.10/site-packages/pykeen/evaluation/classification_evaluator.py:111, in ClassificationEvaluator.finalize(self)
    107 def finalize(self) -> ClassificationMetricResults:  # noqa: D102
    108     # Because the order of the values of an dictionary is not guaranteed,
    109     # we need to retrieve scores and masks using the exact same key order.
    110     all_keys = list(self.all_scores.keys())
--> 111     y_score = np.concatenate([self.all_scores[k] for k in all_keys], axis=0).flatten()
    112     y_true = np.concatenate([self.all_positives[k] for k in all_keys], axis=0).flatten()
    114     # Clear buffers

File <__array_function__ internals>:200, in concatenate(*args, **kwargs)

ValueError: need at least one array to concatenate
```