Subgraph¶
SignalSubgraph Estimators¶

class
graspologic.subgraph.
SignalSubgraph
[source]¶ Estimate the signalsubgraph of a set of labeled graph samples.
The incoherent estimator finds the signalsubgraph, constrained by the number of edges. The coherent estimator finds the signalsubgraph, constrained by the number of edges and by the number of vertices that the edges in the signalsubgraph may be incident to.
Parameters: graphs: arraylike, shape (n_vertices, n_vertices, s_samples)
A series of labeled (n_vertices, n_vertices) unweighted graph samples. If undirected, the upper or lower triangle matrices should be used.
labels: vector, length (s_samples)
A vector of class labels. There must be a maximum of two classes.
Attributes: contmat_: arraylike, shape (n_vertices, n_vertices, 2, 2)
An array that stores the 2by2 contingency matrix for each point in the graph samples.
sigsub_: tuple, shape (2, n_edges)
A tuple of a row index array and column index array, where n_edges is the size of the signalsubgraph determined by
constraints
.mask_: arraylike, shape (n_vertices, n_vertices)
An array of boolean values. Entries are true for edges that are in the signal subgraph.
References
[R1c640a56e91a1]  Vogelstein, W. R. Gray, R. J. Vogelstein, and C. E. Priebe, "Graph Classification using SignalSubgraphs: Applications in Statistical Connectomics," arXiv:1108.1427v2 [stat.AP], 2012.

fit
(self, graphs, labels, constraints)[source]¶ Fit the signalsubgraph estimator according to the constraints given.
Parameters: graphs: arraylike, shape (n_vertices, n_vertices, s_samples)
A series of labeled (n_vertices, n_vertices) unweighted graph samples. If undirected, the upper or lower triangle matrices should be used.
labels: vector, length (s_samples)
A vector of class labels. There must be a maximum of two classes.
constraints: int or vector
The constraints that will be imposed onto the estimated signalsubgraph.
If
constraints
is an int,constraints
is the number of edges in the signalsubgraph. Ifconstraints
is a vector, the first element ofconstraints
is the number of edges in the signalsubgraph, and the second element ofconstraints
is the number of vertices that the signalsubgraph must be incident to.Returns:  self: returns an instance of self

fit_transform
(self, graphs, labels, constraints)[source]¶ A function to return the indices of the signalsubgraph. If
return_mask
is True, also returns a mask for the signalsubgraph.Parameters: graphs: arraylike, shape (n_vertices, n_vertices, s_samples)
A series of labeled (n_vertices, n_vertices) unweighted graph samples. If undirected, the upper or lower triangle matrices should be used.
labels: vector, length (s_samples)
A vector of class labels. There must be a maximum of two classes.
constraints: int or vector
The constraints that will be imposed onto the estimated signalsubgraph.
If
constraints
is an int,constraints
is the number of edges in the signalsubgraph. Ifconstraints
is a vector, the first element ofconstraints
is the number of edges in the signalsubgraph, and the second element ofconstraints
is the number of vertices that the signalsubgraph must be incident to.Returns: sigsub: tuple
Contains an array of row indices and an array of column indices.