grakel.HadamardCode

class grakel.HadamardCode(n_jobs=None, verbose=False, normalize=False, n_iter=5, base_graph_kernel=None)[source][source]

The simple Hadamard code kernel, as proposed in [KI16].

Parameters
base_graph_kernelgrakel.kernels.Kernel or tuple, default=None

If tuple it must consist of a valid kernel object and a dictionary of parameters. General parameters concerning normalization, concurrency, .. will be ignored, and the ones of given on __init__ will be passed in case it is needed. Default base_graph_kernel is VertexHistogram.

rhoint, condition_of_appearance: hc_type==”shortened”, default=-1

The size of each single bit arrays. If -1 is chosen r is calculated as the biggest possible that satisfies an equal division.

Lint, condition_of_appearance: hc_type==”shortened”, default=4

The number of bytes to store the bitarray of each label.

n_iterint, default=5

The number of iterations.

Attributes
base_graph_kernel_function

A void function that initializes a base kernel object.

Methods

diagonal()

Calculate the kernel matrix diagonal for fitted data.

fit(X[, y])

Fit a dataset, for a transformer.

fit_transform(X[, y])

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 a pairwise kernel between two elements.

parse_input(X)

Parse input and create features, while initializing and/or calculating sub-kernels.

set_params(**params)

Call the parent method.

transform(X)

Calculate the kernel matrix, between given and fitted dataset.

Initialise a hadamard_code kernel.

Attributes
X

Methods

diagonal()

Calculate the kernel matrix diagonal for fitted data.

fit(X[, y])

Fit a dataset, for a transformer.

fit_transform(X[, y])

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 a pairwise kernel between two elements.

parse_input(X)

Parse input and create features, while initializing and/or calculating sub-kernels.

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, n_iter=5, base_graph_kernel=None)[source][source]

Initialise a hadamard_code kernel.

Bibliography

KI16

Tetsuya Kataoka and Akihiro Inokuchi. Hadamard code graph kernels for classifying graphs. In Proceedings of the 5th International Conference on Pattern Recognition Applications and Methods, 24–32. 2016.