grakel.SubgraphMatching

class grakel.SubgraphMatching(n_jobs=None, verbose=False, normalize=False, k=5, kv=<function _dirac>, ke=<function _dirac>, lw='uniform')[source][source]

Calculate the subgraph matching kernel.

See [KM12].

Parameters
kint, default=5

The upper bound for the maximum size of subgraphs.

lwstr, valid_values={“uniform”, “increasing”, “decreasing”, “strong_decreasing”},
default=”uniform” | iterable, size=k+1,
| callable, num_of_arguments=1, argument_type=int

The lambda weights applied to the clique sizes.

kvfunction (vertex_label, `vertex_label, -> number), or None
default=:math:`k_{v}^{default}(l(a), l(b))= delta(l(a), l(b))`

The kernel function between two vertex_labels. If no function is provided, this is equivalent with not taking into account node labels.

kefunction (edge_label, edge_label -> number),
default=:math:`k_{e}^{default}(l(e), l(e’))= delta(l(e), l(e’))`

The kernel function between two edge_labels. If no function is provided, this is equivalent with not taking into account edge labels.

Attributes
lambdas_np.array, shape=(1, k+1)

All the lambdas corresponding to all the valid sizes of subgraphs.

Methods

diagonal()

Calculate the kernel matrix diagonal of the fit/transformed data.

fit(X[, y])

Fit a dataset, for a transformer.

fit_transform(X)

Fit and transform, on the same dataset.

get_params([deep])

Get parameters for this estimator.

initialize()

Initialize all transformer arguments, needing initialization.

pairwise_operation(x, y)

Calculate the subgraph_matching kernel.

parse_input(X)

Parse and create features for the subgraph_matching kernel.

set_params(**params)

Call the parent method.

transform(X)

Calculate the kernel matrix, between given and fitted dataset.

Initialise a subgraph_matching kernel.

Attributes
X

Methods

diagonal()

Calculate the kernel matrix diagonal of the fit/transformed data.

fit(X[, y])

Fit a dataset, for a transformer.

fit_transform(X)

Fit and transform, on the same dataset.

get_params([deep])

Get parameters for this estimator.

initialize()

Initialize all transformer arguments, needing initialization.

pairwise_operation(x, y)

Calculate the subgraph_matching kernel.

parse_input(X)

Parse and create features for the subgraph_matching kernel.

set_params(**params)

Call the parent method.

transform(X)

Calculate the kernel matrix, between given and fitted dataset.

__init__(n_jobs=None, verbose=False, normalize=False, k=5, kv=<function _dirac>, ke=<function _dirac>, lw='uniform')[source][source]

Initialise a subgraph_matching kernel.

Bibliography

KM12

Nils Kriege and Petra Mutzel. Subgraph Matching Kernels for Attributed Graphs. In Proceedings of the 29th International Conference on Machine Learning, 291–298. 2012.