grakel.Propagation¶
- class grakel.Propagation(n_jobs=None, verbose=False, normalize=False, random_state=None, metric=<function _dot>, M='TV', t_max=5, w=0.01)[source][source]¶
 The Propagation kernel for fully labeled graphs.
See [NGBK15]: Algorithms 1, 3, p. 216, 221.
- Parameters
 - t_maxint, default=5
 Maximum number of iterations.
- wint, default=0.01
 Bin width.
- Mstr, default=”TV”
 - The preserved distance metric (on local sensitive hashing):
 “H”: hellinger
“TV”: total-variation
- metricfunction (Counter, Counter -> number),
 default=:math:f(x,y)=sum_{i} x_{i}*y_{i} A metric between two 1-dimensional numpy arrays of numbers that outputs a number. It must consider the case where the keys of y are not in x, when different features appear at transform.
- random_stateRandomState or int, default=None
 A random number generator instance or an int to initialize a RandomState as a seed.
- Attributes
 - _enum_labelsdict
 Holds the enumeration of the input labels.
- _parent_labelsset
 Holds a set of the input labels.
- random_state_RandomState
 A RandomState object handling all randomness of the class.
Methods
calculate_LSH(X, u, b)Calculate Local Sensitive Hashing needed for propagation kernels.
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 initialization.
pairwise_operation(x, y)Calculate the kernel value between two elements.
parse_input(X)Parse and create features for the propation kernel.
set_params(**params)Call the parent method.
transform(X)Calculate the kernel matrix, between given and fitted dataset.
Initialise a propagation kernel.
- Attributes
 - X
 
Methods
calculate_LSH(X, u, b)Calculate Local Sensitive Hashing needed for propagation kernels.
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 initialization.
pairwise_operation(x, y)Calculate the kernel value between two elements.
parse_input(X)Parse and create features for the propation kernel.
set_params(**params)Call the parent method.
transform(X)Calculate the kernel matrix, between given and fitted dataset.