graphdot.experimental.alterantive_mgk package

class graphdot.experimental.alterantive_mgk.AltMarginalizedGraphKernel(*args, **kwargs)[source]

Bases: graphdot.kernel.marginalized._kernel.MarginalizedGraphKernel

__call__(X, ij, lmin=0, timing=False)[source]

Compute a list of pairwise similarities between graphs.

Parameters:
  • X (list of N graphs) – The graphs must all have same node and edge attributes.
  • ij (list of pairs of ints) – Pair indices for which the graph kernel is to be evaluated.
  • lmin (0 or 1) – Number of steps to skip in each random walk path before similarity is computed. (lmin + 1) corresponds to the starting value of l in the summation of Eq. 1 in Tang & de Jong, 2019 https://doi.org/10.1063/1.5078640 (or the first unnumbered equation in Section 3.3 of Kashima, Tsuda, and Inokuchi, 2003).
Returns:

gramian – A vector with the same length as ij

Return type:

ndarray

trait_t

alias of Traits

classmethod traits(lmin=0)[source]