Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

save_map()

Write the causal map to a folder: three CSV tables and one GraphML file.

save_map(
    cmap: dict,
    folder: str,
) -> list[str]

Source: theoryminer/causal_map.py

The files: nodes.csv one row per node, also the nodes that no shown edge touches (shown False) edges.csv one row per shown edge hidden.csv one row per hidden edge, with its drop_reason map.graphml every node and edge, for Gephi or Cytoscape desktop In the CSV files, a list (members, doc_ids, rel_ids) is one text, joined by “ | “. The function overwrites old files of the same name.

Arguments

cmap

The map to save.

  • Values: the result of causal_map().
  • Default: none. Give the map.

folder

The folder for the four files.

  • Values: the path of a folder. A missing folder is made.
  • Default: none. Give a folder.

Returns

A list of the paths of the four files.

Example

>>> save_map(cmap, "outputs/my_map")
saved map: outputs/my_map (nodes.csv, edges.csv, hidden.csv, map.graphml)