src.preprocessing.find_storylines

Find the storylines in the data.

Functions

find_storylines(graph)

Find the storylines in the graph.

Classes

FindStorylines()

Find the storylines in the data.

class src.preprocessing.find_storylines.FindStorylines[source]

Find the storylines in the data.

The data is expected to have an “adj_list” and “adj_weights” column that contains the adjacency list of the graph. It will return the data with a “storyline” column that contains the storyline index for each row.

custom_transform(data, **transform_args)[source]

Find the storylines in the data.

Parameters:
  • data (DataFrame) – The data to find the storylines in.

  • transform_args (Never) – [UNUSED] Additional keyword arguments.

Return type:

DataFrame

Returns:

The data with the storylines.

src.preprocessing.find_storylines.find_storylines(graph)[source]

Find the storylines in the graph.

The storylines are found by repeatedly checking the shortest path from the source node to every other node and taking the longest path.

Parameters:

graph (PyDiGraph) – The graph to find the storylines in.

Return type:

list[list[int]]

Returns:

The storylines as list of lists of node IDs.