class_docstr: Tests for dataset analysis utilities.
class_docstr_tok: ["Tests","for","dataset","analysis","utilities","."]
docstr: Tests for relation cardinality type classification.
docstr_tok: ["Tests","for","relation","cardinality","type","classification","."]
code: def test_relation_cardinality_types(self):
      """Tests for relation cardinality type classification."""
      df = dataset_analysis.get_relation_cardinality_types_df(
          dataset=self.dataset,
      )
  
      # check correct type
      assert isinstance(df, pandas.DataFrame)
  
      # check relation_id value range
      assert (
          df[triple_analysis.RELATION_ID_COLUMN_NAME]
          .isin(self.dataset.relation_to_id.values())
          .all()
      )
  
      # check pattern value range
      assert (
          df[triple_analysis.CARDINALITY_TYPE_COLUMN_NAME]
          .isin(triple_analysis.RELATION_CARDINALITY_TYPES)
          .all()
      )
  
imports: import itertools
  import unittest
  from typing import Iterable, Mapping
  import numpy
  import pandas
  from pykeen.datasets import Dataset, Nations
  from pykeen.datasets import analysis
  from pykeen.triples import analysis
  from pykeen.typing import LABEL_HEAD, LABEL_TAIL
label_desc: Use image node_id 6 for calling the DatasetAnalysisTests obj's underlying member method code with example usage: obj.test_relation_cardinality_types() without return types