Python package computing Weisfeiler-Lehman graph kernels
Project description
PyWLGK
Python implementation of the Weisfeiler-Lehman Graph Kernels (WLKs) method. This package is an alternative to FastWLK, GraKel, and other implementations of the WLKs method.
Installation
By design, PyWLGK is installable from PyPI and Anaconda. To install the package with pip
, run the following command:
pip install pywlgk
or with conda
(alternatively with mamba
by replacing conda
with mamba
conda install pywlgk
Usage
PyWLGK is designed to be easy to use. The following example shows how to use PyWLGK to compute the WLKs kernel between two graphs.
from pywlgk import wlk
import numpy as np
adjs = np.random.randint(0, 1, size=(2, 10, 10))
adjs = np.array(adjs + adjs.transpose(0, 2, 1), dtype=np.int32)
labels = np.ones((2, 10), dtype=np.int32)
wlk(adjs, labels, k=4)
PyWLGK takes as input a stack of adjacency matrices (adjs
) and a stack of node labels (labels
). The adjacency
matrices must be symmetric, whereas the labels can have any type. Additionally, one can specify a k
to control how
many iterations of the kernel will be computed.
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 Distribution
File details
Details for the file pywlgk-1.0.1.tar.gz
.
File metadata
- Download URL: pywlgk-1.0.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b12472bcf19ec71065c8f9cc5449f56e8b5895138cfb560cfd3f4b66598a1e1 |
|
MD5 | cfa9d4989aaede09c06530512b6c6230 |
|
BLAKE2b-256 | 9dbf696c8396f0b62747f2d02c0aba9e9ea9d08bfc88e271142535367c4a859d |
File details
Details for the file PyWLGK-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: PyWLGK-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c37991535c853751dbfe5d3b0044985a425e1e5e4c75bb9c3afeccc607a3597c |
|
MD5 | 7f8601ea710bbc24277b5bc628ae2f45 |
|
BLAKE2b-256 | a371bbe51430e1be4ae2ea8af2db26ec8a7129c30089a67848ba6cc180ddac72 |