A scikit-learn compatible library for graph kernels
Project description
[!NOTE] grakelx is an independent fork of GraKeL by Siglidis, Nikolentzos, Limnios, Giatsidis, Skianis, and Vazirgiannis, originally published in JMLR 2020. This fork continues maintenance and development under the BSD 3-clause license. See LICENSE and the Acknowledgements section below.
Upstream Documentation | Paper
grakelx is a library that provides implementations of several well-established graph kernels. The library unifies these kernels into a common framework. Furthermore, it provides implementations of some frameworks that work on top of graph kernels. Specifically, grakelx contains 16 kernels and 3 frameworks. The library is compatible with the scikit-learn pipeline allowing easy and fast integration inside machine learning algorithms.
In detail, the following kernels and frameworks are currently implemented:
- Vertex histogram kernel
- Edge histogram kernel
- Shortest path kernel from Borgwardt and Kriegel: Shortest-path kernels on graphs (ICDM 2005)
- Graphlet kernel from Shervashidze et al.: Efficient graphlet kernels for large graph comparison (AISTATS 2009)
- Random walk kernel from Vishwanathan et al.: Graph Kernels (JMLR 11(Apr))
- Neighborhood hash graph kernel from Hido and Kashima: A Linear-time Graph Kernel (ICDM 2009)
- Weisfeiler-Lehman framework from Shervashidze et al.: Weisfeiler-Lehman Graph Kernels (JMLR 12(Sep))
- Neighborhood subgraph pairwise distance kernel from Costa and De Grave: Fast Neighborhood Subgraph Pairwise Distance Kernel (ICML 2010)
- Lovasz-theta kernel from Johansson et al.: Global graph kernels using geometric embeddings (ICML 2014)
- SVM-theta kernel from Johansson et al.: Global graph kernels using geometric embeddings (ICML 2014)
- Ordered decompositional DAG kernel from Da San Martino et al.: A Tree-Based Kernel for Graphs (SDM 2012)
- GraphHopper kernel from Feragen et al.: Scalable kernels for graphs with continuous attributes (NIPS 2013)
- Propagation kernel from Neumann et al.: Propagation kernels: efficient graph kernels from propagated information (Machine Learning 102(2))
- Pyramid match kernel from Nikolentzos et al.: Matching Node Embeddings for Graph Similarity (AAAI 2017)
- Subgraph matching kernel from Kriege and Mutzel: Subgraph Matching Kernels for Attributed Graphs (ICML 2012)
- Multiscale Laplacian kernel from Kondor and Pan: The Multiscale Laplacian Graph Kernel (NIPS 2016)
- Core framework from Nikolentzos et al.: A Degeneracy Framework for Graph Similarity (IJCAI 2018)
- Weisfeiler-Lehman optimal assignment kernel from Kriege et al.: On Valid Optimal Assignment Kernels and Applications to Graph Classification (NIPS 2016)
To learn how to install and use grakelx, and to find out more about the implemented kernels and frameworks, please read our documentation. To learn about the functionality of the library and about example applications, check out our examples in the examples/ directory.
In case you find a bug, please open an issue. To propose a new kernel, you can open a feature request.
Installation
grakelx requires the following packages to be installed:
- Python (>=3.10)
- NumPy (>=1.23.0)
- SciPy (>=1.8.0)
- Cython (>=0.29.36)
- cvxopt (>=1.2.0) [optional]
- future (>=0.16.0)
To install the package, run:
pip install grakelx
For local development with uv:
uv sync --group test
uv run python setup.py build_ext --inplace
uv run pre-commit install
Running tests
To test the package, execute:
uv run pytest
Running examples
cd examples
python shortest_path.py
Cite
If you use grakelx in a scientific publication, please cite the original GraKeL paper (http://jmlr.org/papers/volume21/18-370/18-370.pdf):
@article{JMLR:v21:18-370,
author = {Giannis Siglidis and Giannis Nikolentzos and Stratis Limnios and Christos Giatsidis and Konstantinos Skianis and Michalis Vazirgiannis},
title = {GraKeL: A Graph Kernel Library in Python},
journal = {Journal of Machine Learning Research},
year = {2020},
volume = {21},
number = {54},
pages = {1-5}
}
License
grakelx is distributed under the BSD 3-clause license (same as the original GraKeL). The library makes use of the C++ source code of BLISS (a tool for computing automorphism groups and canonical labelings of graphs) which is LGPL licensed. Furthermore, the cvxopt package (a software package for convex optimization) which is an optional dependency of grakelx is GPL licensed.
Acknowledgements
We would like to thank @eddiebergman for modernizing the original GraKeL CI and extending Python support.
This project is a fork of GraKeL by Giannis Siglidis, Giannis Nikolentzos, Stratis Limnios, Christos Giatsidis, Konstantinos Skianis, and Michalis Vazirgiannis, originally published in JMLR 2020 (paper). The original copyright holders are the GraKeL developers. All modifications and additions in this fork are released under the same BSD 3-clause license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file grakelx-0.1.12.tar.gz.
File metadata
- Download URL: grakelx-0.1.12.tar.gz
- Upload date:
- Size: 1.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7da19e0d3098dd507757bce00fb34142127aeb46bed1d035174d8a741797f532
|
|
| MD5 |
4f5f65cd9b49b6a2577b4b5303a66e6a
|
|
| BLAKE2b-256 |
ae565679adc24f8fa3c18ae148fc52551fb39d0d0923d710208976c943c5dfea
|
File details
Details for the file grakelx-0.1.12-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: grakelx-0.1.12-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 535.4 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0e89832e5d7b1e7941832b1224757cd5e88d2624fd37ecd037e85b65b037d60
|
|
| MD5 |
71bdfb4f0f47c43509a017c2cdba4553
|
|
| BLAKE2b-256 |
f463784aa29030b7301b1e11672e61cd308c680ba3802472171ac85fe3f82754
|
File details
Details for the file grakelx-0.1.12-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: grakelx-0.1.12-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.13, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1578a5491bfcbdb38c7d15bd33dc0c2c89dbce272149b0c9da3811e76d85b35
|
|
| MD5 |
db821269ae45b9298470f07f45d65994
|
|
| BLAKE2b-256 |
4768f143ff892cb1ff3e1c0a1e46a50e4946c589251ebc8a05bbc84c1f6ba4b3
|
File details
Details for the file grakelx-0.1.12-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: grakelx-0.1.12-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.13, manylinux: glibc 2.24+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
436978fb9bf7cf9257c491a44f676f69d928e05a945b3e7e5778594fa710c16f
|
|
| MD5 |
9af121e52cd83196d0d4d98ee5db6ad0
|
|
| BLAKE2b-256 |
4ae2f06cf23f54ed2832be64801e20457b95b2b5bca080defb1a051fcf650618
|
File details
Details for the file grakelx-0.1.12-cp313-cp313-macosx_10_13_x86_64.whl.
File metadata
- Download URL: grakelx-0.1.12-cp313-cp313-macosx_10_13_x86_64.whl
- Upload date:
- Size: 393.5 kB
- Tags: CPython 3.13, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52de4d74e02c93e999a1da9fcae4e5691fbe8cd35ba2d699ab89f0a6bdf18b55
|
|
| MD5 |
2bb91f6ecf241f431e86b88155164bd8
|
|
| BLAKE2b-256 |
ffbdd98f4082410e5d2ea0e698d140066c0112c2354131b217cd1e3e7c650268
|
File details
Details for the file grakelx-0.1.12-cp313-cp313-macosx_10_13_universal2.whl.
File metadata
- Download URL: grakelx-0.1.12-cp313-cp313-macosx_10_13_universal2.whl
- Upload date:
- Size: 714.1 kB
- Tags: CPython 3.13, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88cef4050c4c360d994f393da7f6b54ed5c543e5e9b20dd148568e09329ea4f3
|
|
| MD5 |
6fb8d8b8048963e199fb3810ff1033e1
|
|
| BLAKE2b-256 |
8fc5df5635118acee9b1d4581dda4bfea43b93b6017845abf82aaa29677ae910
|
File details
Details for the file grakelx-0.1.12-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: grakelx-0.1.12-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 536.3 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05fcdcfd33f38d1fb2a5699c6f52dbe320f59d384da9ef413052fda7eb14c006
|
|
| MD5 |
f99e381de0ca59298940d685ad0154c8
|
|
| BLAKE2b-256 |
9041b4789e3f88d686fc7b2b3472d0e3eb73467958e39946516230c8a8610c70
|
File details
Details for the file grakelx-0.1.12-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: grakelx-0.1.12-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.12, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7eeb39d47139c204ce249df1b7ec6d57793810769599ac5c3e11dd6ca39daed2
|
|
| MD5 |
818e8a72ea72f96483cbfcb4e41c27f4
|
|
| BLAKE2b-256 |
706066c8afabfb18693833cf58963783e640a2c6ea679fcde9bf49390322bb60
|
File details
Details for the file grakelx-0.1.12-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: grakelx-0.1.12-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.12, manylinux: glibc 2.24+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e29987c6cfd6b28a09cea586541be6e780dcc5ffb956042f75c49f10b0841c07
|
|
| MD5 |
f4e3b31682597cf4bd7fad1f9976e87c
|
|
| BLAKE2b-256 |
a6eff2a17fd696ae1ee5f4a18634d5ea4626627bc9fa0df71b15f3d7c362653b
|
File details
Details for the file grakelx-0.1.12-cp312-cp312-macosx_10_13_x86_64.whl.
File metadata
- Download URL: grakelx-0.1.12-cp312-cp312-macosx_10_13_x86_64.whl
- Upload date:
- Size: 394.3 kB
- Tags: CPython 3.12, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cccb7daf8283d3921b3b20555b3582db44c8a6cdeafe81035cba4c8d784cec21
|
|
| MD5 |
0170a790721ac092348b0cf2d8a06dbd
|
|
| BLAKE2b-256 |
eae2384889077e8ae89fbc23826857e56bec8fd5959754d4717502e65d1591bd
|
File details
Details for the file grakelx-0.1.12-cp312-cp312-macosx_10_13_universal2.whl.
File metadata
- Download URL: grakelx-0.1.12-cp312-cp312-macosx_10_13_universal2.whl
- Upload date:
- Size: 716.0 kB
- Tags: CPython 3.12, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2cfbf80ff27f275f1256da4d96549a738050ae467916bf8b74b3a75f240fbd0
|
|
| MD5 |
56ad89ad59af9f71746953ba26c7b808
|
|
| BLAKE2b-256 |
27ed85b99699eb6a6ef122922d2ec001fa4d2f838fde6b95c2eeca920c9cc453
|
File details
Details for the file grakelx-0.1.12-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: grakelx-0.1.12-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 536.4 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
759e32468334a34618f4f756913196618530af83d7f26788b45a9880ff4dd5c9
|
|
| MD5 |
ed0072822df211b7d37e6221fb6aa879
|
|
| BLAKE2b-256 |
a4733505ada98bc4b372a81799f9583262b1597c5f77a889ab3160bfca5a581a
|
File details
Details for the file grakelx-0.1.12-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: grakelx-0.1.12-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.11, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dff020c67163adf93fc36261909f5670d0667987ac56f352c80aa2cf1ecd0e38
|
|
| MD5 |
55780eba69bacb2fc9c3a5a026fdff9a
|
|
| BLAKE2b-256 |
cb347c72a4c27126800c7bcdc45612c154c12ad4161d5aa43b6b294d53caedd7
|
File details
Details for the file grakelx-0.1.12-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: grakelx-0.1.12-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.11, manylinux: glibc 2.24+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c8f68bb185b007b66ad04b3f2415924d13de7237564a9f91cb3070984c68b21
|
|
| MD5 |
3b68375b36a3116dc6c0e87f0dd6e37b
|
|
| BLAKE2b-256 |
a46a067c1b0a8419b03e7cabd85bdf9a550832189dcedd5300fbc1ae1ba03b1a
|
File details
Details for the file grakelx-0.1.12-cp311-cp311-macosx_10_9_x86_64.whl.
File metadata
- Download URL: grakelx-0.1.12-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 393.1 kB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5d9a1c156409c19763a4ed8ae95b111e1e95da4e5b63dd332465c4a67f3d5eb
|
|
| MD5 |
892a98d1c57b947cdbc0a1ec12fc0d2a
|
|
| BLAKE2b-256 |
607d5a29c24b669794b9cdd1dd5a24c4cb650ba88b08902bd8260bd748320aff
|
File details
Details for the file grakelx-0.1.12-cp311-cp311-macosx_10_9_universal2.whl.
File metadata
- Download URL: grakelx-0.1.12-cp311-cp311-macosx_10_9_universal2.whl
- Upload date:
- Size: 718.1 kB
- Tags: CPython 3.11, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5933d52db60e4284616df3b9c4995391b946b2c099813b805a2229998a461856
|
|
| MD5 |
d148103cac1470e2a95ac1333944b935
|
|
| BLAKE2b-256 |
ea2a21d92cc38808cf1da80116fb9dee7fa30f6b521c2890d1b5d8d8b0de062b
|
File details
Details for the file grakelx-0.1.12-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: grakelx-0.1.12-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 536.5 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e85367fd88faa957a10dadf452b1685575e0e57a9988a4a35672c43f0c2ec89b
|
|
| MD5 |
82bb4b9a515a27bfdf213525c9644aaf
|
|
| BLAKE2b-256 |
ac7611b2a85be6b50888fd010150ddd22b1494cb3272e059adca1d7f45969791
|
File details
Details for the file grakelx-0.1.12-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: grakelx-0.1.12-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.10, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e9e9b8cceb3600be18ca91a4bb13404674f482eefbef45568aa8b711ab2015e
|
|
| MD5 |
e18497159ab117d316d5e34d2f340fb1
|
|
| BLAKE2b-256 |
84293ff97c6b324401d803e1b4a1c470efc10ee1ae526d66617f22912fa48865
|
File details
Details for the file grakelx-0.1.12-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: grakelx-0.1.12-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.10, manylinux: glibc 2.24+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a3b045d0b06269478e3be82ef9f1d0f2e3896383de9ab55f727f0fb3883d92c
|
|
| MD5 |
0fa58e8058f25114a7b22176be816e03
|
|
| BLAKE2b-256 |
54271ea7ef09fcb2f73fe08d28e28e6fd0f474848aa583bdd35c6607995c0df0
|
File details
Details for the file grakelx-0.1.12-cp310-cp310-macosx_10_9_x86_64.whl.
File metadata
- Download URL: grakelx-0.1.12-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 393.4 kB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4e590603c681e3ffa1d819dd12324ddb91cb0d46f8e9303015e9075f21fc759
|
|
| MD5 |
a59c7d777eccf3da275a79365ae33d74
|
|
| BLAKE2b-256 |
646ff1055c4b480ad512f6a6c0f03b0495a6aaa79a362853a98ba092aba67b8b
|
File details
Details for the file grakelx-0.1.12-cp310-cp310-macosx_10_9_universal2.whl.
File metadata
- Download URL: grakelx-0.1.12-cp310-cp310-macosx_10_9_universal2.whl
- Upload date:
- Size: 718.5 kB
- Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
387ae0a7d06a013ebe99d7070a60b36aa04624dba5b806521d61d3d7b9481ce1
|
|
| MD5 |
f0314c43089997ae9828891112e60a0b
|
|
| BLAKE2b-256 |
611c3396ad70eacefdfbcf88c438d25811fa5e37e0a26566d5deaa609ac2b6da
|