Question: Complete the function calc _ genrated _ stats to compute various network properties such as network diameter, characteristic path length ( CPL ) , average

Complete the function calc_genrated_stats to compute various network properties such as network diameter, characteristic path length (CPL), average clustering coefficient, transitivity, and assortativity for each grph in a provided list. If any grph is not fully connected, consider using its largest connected component for analysis. The results are returned as a dict where each property is described by a string key, with a list of corresponding values for each grph.
Then, implement the function compare_genrated_to_grnd_truth to perform a one-sample t-test on the empirical network properties against the sampled values from each grph model. It compares the diameter, CPL, average clustering coefficient, transitivity, and assortativity. The results are returned as a dict of p-values.
Lastly, develop the function plt_grph_stats to visually represent the distribution of each network property (e.g., CPL, average clustering) through boxplts. The boxplts are arranged in a single plt with five side-by-side subplts, each depicting one property. The overall plt is labeled with the generator name, and each individual boxplt is labeled with the corresponding property on the y-axis.
def calc_genrated_stats(grphs: List[nx.Grph])-> Dict[str, list]:
"""
Inputs:
grphs: a list of NetworkX grph object
Returns:
a dict of grph stats
"""
return grph_stats
def compare_genrated_to_grnd_truth(grnd_truth_features: Dict[str, float], genrated_features: Dict[str, List[float]])-> Dict[str, float]:
"""
Inputs:
grnd_truth_features: a dict of grph stats
genrated_features: a dict of grph stats
Returns:
a dict of one-sample t-test
"""
return p_vals
def plt_grph_stats(grph_stats: List[Dict[str, list]], save: bool=False)-> None:
"""
Inputs:
grph_stats: a dict of grph stats
Returns:
None
"""

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!