HierarchiesDict

HierarchiesDict#

class HierarchiesDict(hierarchies_dir: str, df: DataFrame, qids: list, qids_idx: list)#

Bases: dict

Dictionary-like manager for attributes’ generalization hierarchies.

This class maps dataset column indices or attribute names to their respective hierarchy definitions. Hierarchy configurations are lazy-loaded of from JSON files stored in the dataset’s directory.

Parameters:
  • hierarchies_dir (str) – The path to the directory containing JSON files for the hierarchies.

  • df (pd.DataFrame) – The original data.

  • qids (list) – A list of names of the QID attributes.

  • qids_idx (list) – The column indices of the QID attributes.

Variables:

hierarchies_dir (str) – Directory path where JSON hierarchy files are located.

Attributes

all_hierarchies_df#

Interactive widget to display all loaded hierarchies on IPython.

Generates a UI component for IPython consisting of a dropdown menu and a display area showing the generalization hierarchy of each QID attribute.

Returns:

ipywidgets.VBox