gklearn.kernels.marginalizedKernel

@author: linlin

@references:

[1] H. Kashima, K. Tsuda, and A. Inokuchi. Marginalized kernels between labeled graphs. In Proceedings of the 20th International Conference on Machine Learning, Washington, DC, United States, 2003.

[2] Pierre Mahé, Nobuhisa Ueda, Tatsuya Akutsu, Jean-Luc Perret, and Jean-Philippe Vert. Extensions of marginalized graph kernels. In Proceedings of the twenty-first international conference on Machine learning, page 70. ACM, 2004.

marginalizedkernel(*args, node_label='atom', edge_label='bond_type', p_quit=0.5, n_iteration=20, remove_totters=False, n_jobs=None, chunksize=None, verbose=True)[source]

Compute marginalized graph kernels between graphs.

Parameters

GnList of NetworkX graph

List of graphs between which the kernels are computed.

G1, G2NetworkX graphs

Two graphs between which the kernel is computed.

node_labelstring

Node attribute used as symbolic label. The default node label is ‘atom’.

edge_labelstring

Edge attribute used as symbolic label. The default edge label is ‘bond_type’.

p_quitinteger

The termination probability in the random walks generating step.

n_iterationinteger

Time of iterations to compute R_inf.

remove_tottersboolean

Whether to remove totterings by method introduced in [2]. The default value is False.

n_jobsint

Number of jobs for parallelization.

Return

KmatrixNumpy matrix

Kernel matrix, each element of which is the marginalized kernel between 2 praphs.

wrapper_marg_do(node_label, edge_label, p_quit, n_iteration, itr)[source]
wrapper_untotter(Gn, node_label, edge_label, i)[source]