Scoring
The scoring submodule contains a collection of scoring function to describe graphs. The scoring function are used to compare graphs.
The scoring function are defined in the
scoring
module.
scoring.default_scores
: contains all available scores in a dictionary {name: score}.scoring.size
: contains additional scores describing the size of the graphs (number of nodes, number of edges)scoring.score_names
: contains a dictionary to convert plain score names to short latex names.
The function scoring.get_default_scores()
return the default_scores in a convenient way, see below
Example of code on a single graph:
import structify_net.scoring
g=nx.karate_club_graph()
score=scoring.hierarchy(g)
scores = scoring.compute_all_scores(g)
Example of code on a graph model:
import structify_net.scoring
model=zoo.sort_nestedness(nodes=100)
model.scores(m=1000)
model.scores(m=1000,scores={"coreness":scoring.coreness},epsilons=[0,0.1,0.2],runs=3,)
Individual scoring functions
|
Check if the graph has a giant component |
Ratio of the largest component to the total number of nodes |
|
|
Transitivity of the graph |
|
Average clustering coefficient of the graph |
The average shortest path length of the graph |
|
|
Returns the modularity of the graph |
|
Compute the degree heterogeneity of the graph |
Returns True if the graph is degree heterogeneous, False otherwise |
|
|
Robustness of the graph |
|
Degree assortativity coefficient of the graph |
|
Hierarchy of the graph |
|
Boundaries of the graph |
|
Coreness of the graph |
Useful functions
|
Compute all scores for a graph |
|
Compute scores for a list of graphs |
|
Scores for a list of generators |
|
Scores for a list of rank models |
|
Scores for a list of rank functions |
|
Compares a list of graphs to a reference graph |
|
Returns the default scores |