class_docstr: Tests for deterioration workflow.
class_docstr_tok: ["Tests","for","deterioration","workflow","."]
docstr: Test deterioration on integer values for ``n``.
docstr_tok: ["Test","deterioration","on","integer","values","for","``","n","``","."]
code: def test_deteriorate(self):
      """Test deterioration on integer values for ``n``."""
      for n in [1, 2, 5, 10, 50, 100, 500, 1000]:
          with self.subTest(n=n):
              derived = self.reference.deteriorate(
                  n=n, random_state=self.generator
              )
              self._help_check(derived)
              self.assertEqual(
                  n, splits_steps(self.reference._tup(), derived._tup())
              )
              self.assertEqual(
                  1 - n / self.num_triples,
                  self.reference.similarity(derived),
                  msg="similarity",
              )
              self.assertEqual(
                  1 - n / self.num_triples,
                  derived.similarity(self.reference),
                  msg="similarity",
              )
  
file_path: pykeen/tests/test_deteriorate.py
imports: import unittest
  from pykeen.datasets.base import Dataset
  from pykeen.datasets.nations import Nations
  from pykeen.triples.triples_factory import splits_steps
  from pykeen.utils import ensure_torch_random_state
label_desc: Use image node_id 2 for calling the TestDeterioration obj's underlying member method code with example usage: obj.test_deteriorate() without return types