class_docstr: Tests for target prediction post-processing.
class_docstr_tok: ["Tests","for","target","prediction","post-processing","."]
code: def _pre_instantiation_hook(
      self, kwargs: MutableMapping[str, Any]
  ) -> MutableMapping[str, Any]:
      kwargs = super()._pre_instantiation_hook(kwargs)
      generator = torch.manual_seed(seed=42)
      target = kwargs["target"]
      self.df = kwargs["df"] = pandas.DataFrame(
          data={
              f"{target}_id": range(self.dataset.num_entities),
              "score": torch.rand(
                  size=(self.dataset.num_entities,), generator=generator
              ),
          }
      )
      return kwargs
  
imports: from typing import Any, Collection, Iterable, MutableMapping, Optional, Sequence, Tuple, Union
  import numpy
  import pandas
  import pytest
  import torch
  import unittest_templates
  import pykeen.models
  import pykeen.models.mocks
  import pykeen.predict
  import pykeen.regularizers
  import pykeen.typing
  from pykeen.constants import COLUMN_LABELS
  from pykeen.datasets.nations import Nations
  from pykeen.triples.triples_factory import AnyTriples, CoreTriplesFactory, KGInfo
  from pykeen.utils import resolve_device
  from tests import cases
label_desc: Use image node_id 1 for calling the TargetPredictionsTests obj's underlying member method code with example usage: obj._pre_instantiation_hook(kwargs) and returns: kwargs