src.preprocessing.linear_programming¶
Perform the linear programming on the clusters.
Classes
|
Create a narrative graph from the clusters and the memberships. |
- class src.preprocessing.linear_programming.LinearProgramming(min_cover=0.6, K=10, threshold=0.01)[source]¶
Create a narrative graph from the clusters and the memberships.
- Parameters:
min_cover (
float
) – the minimum coverage of the memberships.K (
int
) – the expected length of the main story.threshold (
float
) – remove low edges and nodes.
-
min_cover:
float
= 0.6¶
-
K:
int
= 10¶
-
threshold:
float
= 0.01¶
- custom_transform(data, **transform_args)[source]¶
Create the adjacency list and weights based on the solution.
- Parameters:
data (
DataFrame
) – the pandas dataframe containing the embeddings.transform_args (
Never
) – [UNUSED] Additional keyword arguments.
- Return data:
the pandas dataframe containing adjacency list and weights.
- Return type:
DataFrame