Module VITAE.metric
Functions
def topology(G_true, G_pred)-
Evaulate topology metrics.
Parameters
G_true:nx.Graph- The reference graph.
G_pred:nx.Graph- The estimated graph.
Returns
res:dict- a dict containing evaulation results.
def IM_dist(G1, G2)-
The Ipsen-Mikailov distance is a global (spectral) metric, corresponding to the square-root of the squared difference of the Laplacian spectrum for each graph.
Implementation adapt from https://netrd.readthedocs.io/en/latest/_modules/netrd/distance/hamming_ipsen_mikhailov.html
Parameters
G1:nx.GraphG2:nx.Graph
Returns
IM(G1,G2) : float- The IM distance between G1 and G2.
def get_GRI(true, pred)-
Compute the GRI.
Parameters
ture:np.array- [n_samples, n_cluster_1] for proportions or [n_samples, ] for grouping
pred:np.array- [n_samples, n_cluster_2] for estimated proportions or [n_samples, ] for grouping
Returns
GRI:float- The GRI of two groups of proportions in the trajectories.