grakel.KMTransformer

class grakel.KMTransformer(K=None)[source][source]

A Kernel Matrix Transformer.

Usefull for using precalculated Kernel Matrices inside scikit-learn pipeline.

Parameters
Karray-like, shape=[n, n]

If given an array the input can be as follows:

  • array-like lists of lists

  • np.array

  • sparse matrix (scipy.sparse)

It can also be embedded in an sklearn Bunch object as a mat (argument)

Attributes
K_numpy.array, shape=[n, n]

Methods

fit(X[, y])

Fit a list of indeces.

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

set_params(**params)

Set the parameters of this estimator.

transform(X)

Calculate the kernel matrix, between given and fitted dataset.

Initialise the Kernel Matrix Transformer

Methods

fit(X[, y])

Fit a list of indeces.

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

set_params(**params)

Set the parameters of this estimator.

transform(X)

Calculate the kernel matrix, between given and fitted dataset.

__init__(K=None)[source][source]

Initialise the Kernel Matrix Transformer