evaluate_edge_recovery: Evaluate edge recovery against a known network

View source: R/network_analysis.R

evaluate_edge_recoveryR Documentation

Evaluate edge recovery against a known network

Description

Evaluate edge recovery against a known network

Usage

evaluate_edge_recovery(truth, estimate, threshold = 0)

Arguments

truth, estimate

Supported network representations.

threshold

Absolute threshold defining a recovered edge: a dyad counts as present when abs(weight) > threshold.

Value

A tidy simulab_sim base data.frame with one row per dyad in the union of the two edge sets – dyads absent from both networks are not represented, so true negatives are not counted – and columns from, to, truth_weight, estimate_weight, truth_present, estimate_present, recovered, false_positive, and false_negative. A one-row summary table (precision, recall, f1, true_positive, false_positive, false_negative) is available through as.data.frame().

Examples

truth <- simulate_network(nodes = 25, model = "bernoulli", probability = 0.15, seed = 1)
estimate <- simulate_network(nodes = 25, model = "bernoulli", probability = 0.15, seed = 2)
evaluate_edge_recovery(truth, estimate)

simulab documentation built on Oct. 15, 2026, 5:08 p.m.