Skip to main content

Module edge_sampling

Module edge_sampling 

Source
Expand description

Edge sampling and train/test edge splits (ALGO-TR-009).

Utilities for randomly sampling edges and splitting a graph’s edge set into disjoint train/test partitions. Essential for link prediction evaluation: the test edges are held out, and the model must predict them.

Structs§

EdgeSplit
Result of an edge train/test split.

Functions§

sample_edges
Uniformly sample count edges from the graph without replacement.
split_edges
Split graph edges into train and test sets.
split_edges_connected
Split edges ensuring the training graph remains connected.