grakel
.ShortestPathAttr¶
- class grakel.ShortestPathAttr(n_jobs=None, normalize=False, verbose=False, algorithm_type='auto', metric=<function dot>)[source][source]¶
The shortest path kernel for attributes.
The Graph labels are considered as attributes. The computational efficiency is decreased to \(O(|V|^4)\) See [BK05].
- Parameters
- algorithm_typestr, default={“dijkstra”, “floyd_warshall”, “auto”}
Apply the dijkstra or floyd_warshall algorithm for calculating shortest path, or chose automatically (“auto”) based on the current graph format (“auto”).
- metricfunction, default=:math:f(x,y)=sum_{i}x_{i}*y_{i},
The metric applied between attributes of the graph labels. The user must provide a metric based on the format of the provided labels (considered as attributes).
- Attributes
- Xlist
A list of tuples, consisting of shortest path matrices and their feature vectors.
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 initialization.
pairwise_operation
(x, y)Calculate shortests paths on attributes.
parse_input
(X)Parse and create features for the shortest_path kernel.
set_params
(**params)Call the parent method.
transform
(X)Calculate the kernel matrix, between given and fitted dataset.
Initialise a shortest_path_attr kernel.
- 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 initialization.
pairwise_operation
(x, y)Calculate shortests paths on attributes.
parse_input
(X)Parse and create features for the shortest_path kernel.
set_params
(**params)Call the parent method.
transform
(X)Calculate the kernel matrix, between given and fitted dataset.