scglue.models.data.GraphDataset

class scglue.models.data.GraphDataset(graph, vertices, neg_samples=1, weighted_sampling=True, deemphasize_loops=True, getitem_size=1)[源代码]

基类:Dataset

Dataset for graphs with support for negative sampling

参数:
  • graph (Graph) – Graph object

  • vertices (pandas.core.indexes.base.Index) – Indexer of graph vertices

  • neg_samples (int) – Number of negative samples per edge

  • weighted_sampling (bool) – Whether to do negative sampling based on vertex importance

  • deemphasize_loops (bool) – Whether to deemphasize self-loops when computing vertex importance

  • getitem_size (int) – Unitary fetch size for each __getitem__ call

备注

Custom shuffling performs negative sampling.

方法

accept_shuffle

Accept shuffling result

graph2triplet

Convert graph object to graph triplet

propose_shuffle

Propose shuffling using a given random seed

属性

logger