scglue.models.scglue.SCGLUEModel.encode_graph

SCGLUEModel.encode_graph(graph, edge_weight='weight', edge_sign='sign', n_sample=None)[source]

Compute graph (feature) embedding

Parameters
  • graph (Graph) – Input graph

  • edge_weight (str) – Key of edge attribute for edge weight

  • edge_sign (str) – Key of edge attribute for edge sign

  • n_sample (Optional[int]) – Number of samples from the embedding distribution, by default None, returns the mean of the embedding distribution.

Return type

ndarray

Returns

graph_embedding – Graph (feature) embedding with shape \(n_{feature} \times n_{dim}\) if n_sample is None, or shape \(n_{feature} \times n_{sample} \times n_{dim}\) if n_sample is not None.