add_edge_noises

class add_edge_noises(dataset: Dataset, noise_ratio: float, gids: int | List[int] | Tuple[int, ...] | None = None, seed: int | None = None, inplace: bool = False)[source]

Bases:

Add structural noise to graphs in a PlanetAlign dataset by perturbing edges.

Parameters:
  • dataset (PyG dataset) – The input dataset containing graphs.

  • noise_ratio (float) – The ratio of edges to perturb in each graph.

  • gids (int, list of int, or tuple of int) – The graph IDs to perturb. If None, all graphs will be perturbed.

  • seed (int, optional) – Random seed for reproducibility.

  • inplace (bool, optional) – If True, modify the dataset in place. Otherwise, return a new dataset.

Returns:

The dataset with perturbed edges.

Return type:

PyG dataset