Question: Complete the calc _ best _ partition function to determine the resolution associated with the partition that produces the highest NMI. Additionally, complete the plt

Complete the calc_best_partition function to determine the resolution associated with the partition that produces the highest NMI.
Additionally, complete the plt_best_partition function to visualize the network with both the ground truth community assignments and the best partition assignments. Plot both networks side by side as subplots within a single figure. Make sure to label which graph is which (louvain vs ground truth).
def calc_best_partition(G: nx.Graph, res: List[int], nmis: List[float])-> Tuple[int, List[str]]:
"""
Inputs:
G: NetworkX graph object
res : a list of integer
nmis :a list of float
Returns:
Tuple of resolution and partition
"""
return resolution, partition
def plt_best_partition(G: nx.Graph, partition: List[str], save: bool=False)-> None:
"""
Inputs:
G: NetworkX graph object
partition : List[str]
save: boolean
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!