The Explain Method

dedalov2.ddl.explain(hdt_file: str, example_file: str, heuristic: str = 'entropy', groupid: int = None, prefix: str = None, blacklist: str = None, truncate: int = 0, balance: bool = True, prune: str = 'gle', mem_profile: bool = False, runtime: float = inf, rounds: float = inf, complete: int = 0, minimum_score: float = inf, memlimit: float = inf) → Iterator[dedalov2.explanation.Explanation]

Explain why a group of URIs belong together using Semantic Web technology.

Parameters:
  • hdt_file (str) – The location of the HDT file to search for explanations. Instead of traversing the LOD-cloud, Dedadov2 offers increased performance in exchange for using a preconstructed file containing the linked data. HDT is a space-efficiant storage format for linked data.
  • example_file (str) – The location of the text file with input examples and their groups.
  • heuristic (str, optional) – The search heuristic that determines which path should be explored next, defaults to “entropy”
  • groupid (int, optional) – The id of the group that should be explained, defaults to None
  • prefix (str, optional) – The location of a tsv-file with URI prefixes. This makes printed URIs easier to read, defaults to None
  • blacklist (str, optional) – The location of a text file with predicate URIs (one per line) that Dedalov2 must ignore, defaults to None
  • truncate (int, optional) – If this value is larger than 0, both the number of positive examples (URIs from the given group id) and the number of negative examples (URIs from all other groups) are truncated to this amount, defaults to 0
  • balance (bool, optional) – Discard examples such that that the number of positive and negative examples are equal, defaults to True
  • prune (str, optional) – The path pruning policy to use, defaults to “gle”
  • mem_profile (bool, optional) – If set to True, occassionaly log memory usage data, defaults to False
  • runtime (float, optional) – The mamimum allowed runtime. Stop searching after this time, defaults to math.inf
  • rounds (float, optional) – Stop searching after this number of rounds. Every round, one path is explored, defaults to math.inf
  • complete (int, optional) – If larger than 0, stop searching after all explanations with the given path length have been found. an be used to implement complete search to limited depth, defaults to 0
  • minimum_score (float, optional) – If equal or greater to zero, only return explanations with a score greater or equal to the given value, defaults to -1
  • memlimit (float, optional) – Stop searching if the program uses more than the given amount of memory in bytes. Can help prevent MemoryErrors, defaults to math.inf
Returns:

All explanations that meet the given requirements

Return type:

Iterator[Explanation]