grakel.Kernel

class grakel.Kernel(n_jobs=None, normalize=False, verbose=False)[source][source]

A general class for graph kernels.

At default a kernel is considered as pairwise. Doing so the coder that adds a new kernel, possibly only needs to overwrite the attributes: parse_input and pairwise_operation on the new kernel object.

Parameters
n_jobsint or None, optional

Defines the number of jobs of a joblib.Parallel objects needed for parallelization or None for direct execution.

normalizebool, optional

Normalize the output of the graph kernel.

verbosebool, optional

Define if messages will be printed on stdout.

Attributes
Xlist

Stores the input that occurs from parse input, on fit input data. Default format of the list objects is grakel.graph.graph.

_graph_formatstr

Stores in which type the graphs will need to be stored.

_verbosebool

Defines if two print arguments on stdout.

_normalizebool

Defines if normalization will be applied on the kernel matrix.

_valid_parametersset

Holds the default valid parameters names for initialization.

_method_callingint
An inside enumeration defines which method calls another method.
  • 1 stands for fit

  • 2 stands for fit_transform

  • 3 stands for transform

_parallelsklearn.external.joblib.Parallel or None

A Parallel initialized object to imply parallelization to kernel execution. The use of this object depends on the implementation of each base kernel.

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 initialisation.

pairwise_operation(x, y)

Calculate a pairwise kernel between two elements.

parse_input(X)

Parse the given input and raise errors if it is invalid.

set_params(**params)

Call the parent method.

transform(X)

Calculate the kernel matrix, between given and fitted dataset.

__init__ for kernel object.

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 initialisation.

pairwise_operation(x, y)

Calculate a pairwise kernel between two elements.

parse_input(X)

Parse the given input and raise errors if it is invalid.

set_params(**params)

Call the parent method.

transform(X)

Calculate the kernel matrix, between given and fitted dataset.

__init__(n_jobs=None, normalize=False, verbose=False)[source][source]

__init__ for kernel object.

Bibliography