textnets.network.TextnetBase¶
- class textnets.network.TextnetBase(graph: Graph)[source]¶
Bases:
ABC
Abstract base class for
Textnet
andProjectedTextnet
.- graph¶
Direct access to the igraph object.
- Type:
Methods
Return the number of edges.
plot
Save the underlying graph.
Show top nodes per cluster, ranked by a chosen metric.
Show nodes sorted by unweighted degree.
Show nodes sorted by weighted degree.
Return the number of vertices (nodes).
Attributes
Weighted local clustering coefficient within each cluster's subgraph.
Weighted node degree within each cluster's subgraph.
Return graph partition.
Unweighted node degree.
Iterate of edges.
Return modularity based on graph partition.
Return list of node types.
Iterate over nodes.
Weighted node degree.
Summary of underlying graph.
- property cluster_local_cc: Series¶
Weighted local clustering coefficient within each cluster’s subgraph.
- property clusters: VertexClustering¶
Return graph partition.
The partition is detected by the Leiden algorithm, unless a different partition that was supplied to the setter.
- property edges: EdgeSeq¶
Iterate of edges.
- property nodes: VertexSeq¶
Iterate over nodes.
- save_graph(target: str | bytes | PathLike[Any] | IO, format: str | None = None) None [source]¶
Save the underlying graph.
- Parameters:
target (str or path or file) – File or path that the graph should be written to.
format ({"dot", "edgelist", "gml", "graphml", "pajek", ...}, optional) – Optionally specify the desired format (otherwise it is inferred from the file suffix).
- top_cluster_nodes(n: int = 10, rank_nodes_by: str = 'cluster_strength') DataFrame [source]¶
Show top nodes per cluster, ranked by a chosen metric.
- Parameters:
- Returns:
Clusters with representative nodes.
- Return type:
- top_degree(n=10)¶
Show nodes sorted by unweighted degree.
- Parameters:
n (int, optional) – How many nodes to show (default: 10).
- Returns:
Ranked nodes.
- Return type: