Skip to main content
QUICK REVIEW

[Paper Review] GraKeL: A Graph Kernel Library in Python

Giannis Siglidis, Giannis Nikolentzos|arXiv (Cornell University)|Jun 6, 2018
Advanced Graph Neural NetworksComputer Science5 references29 citations
TL;DR

GraKeL is a Python library that unifies multiple state-of-the-art graph kernels into a scikit-learn-compatible framework, enabling seamless integration into machine learning pipelines for graph classification and clustering. It supports 15 kernels and 2 kernel frameworks, offers efficient computation via Cython and NumPy, and outperforms existing libraries like graphkernels in speed and usability while providing a standardized interface for kernel comparison and evaluation.

ABSTRACT

The problem of accurately measuring the similarity between graphs is at the core of many applications in a variety of disciplines. Graph kernels have recently emerged as a promising approach to this problem. There are now many kernels, each focusing on different structural aspects of graphs. Here, we present GraKeL, a library that unifies several graph kernels into a common framework. The library is written in Python and adheres to the scikit-learn interface. It is simple to use and can be naturally combined with scikit-learn's modules to build a complete machine learning pipeline for tasks such as graph classification and clustering. The code is BSD licensed and is available at: https://github.com/ysig/GraKeL .

Motivation & Objective

  • To unify diverse graph kernel implementations into a single, reusable, and extensible framework.
  • To enable seamless integration of graph kernels into scikit-learn-based machine learning pipelines.
  • To provide a standardized, extensible, and efficient platform for comparing and evaluating graph kernels.
  • To support both discrete and continuous vertex/edge attributes, and handle labeled and unlabeled graphs.
  • To promote reproducibility and collaboration in graph kernel research through BSD licensing and comprehensive documentation.

Proposed method

  • The library implements all graph kernels by inheriting a base Kernel class that extends scikit-learn's TransformerMixin, ensuring compatibility with scikit-learn's API.
  • Kernels are computed using optimized numerical operations via NumPy and SciPy, with performance-critical components compiled using Cython.
  • The framework supports both labeled and continuous attribute graphs, with specialized handling for vertex and edge features.
  • Graph isomorphism checks are performed using BLISS for small graphs, and the Lovász theta function is computed via CVXOPT for specific kernels.
  • The library provides a datasets submodule to access standard graph classification benchmarks such as MUTAG and ENZYMES.
  • It enables end-to-end workflows via fit_transform and transform methods, supporting training and inference on separate graph collections.

Experimental results

Research questions

  • RQ1How can a diverse set of graph kernels be unified under a single, extensible, and user-friendly software framework?
  • RQ2To what extent does GraKeL improve computational efficiency compared to existing graph kernel libraries?
  • RQ3Can GraKeL be natively integrated into scikit-learn pipelines for graph-based machine learning tasks?
  • RQ4How does the library’s design facilitate the evaluation and comparison of new graph kernel implementations?
  • RQ5What performance gains does GraKeL achieve over alternative implementations like graphkernels on standard benchmarks?

Key findings

  • GraKeL implements 15 distinct graph kernels and 2 kernel frameworks, significantly outpacing the graphkernels library, which offers only 6 kernel variants.
  • On the ENZYMES benchmark dataset, GraKeL’s kernel computation is faster than the corresponding C++ implementation in graphkernels, demonstrating superior efficiency.
  • The library achieves high accuracy—84.21%—on the MUTAG dataset using the ShortestPath kernel and an SVM classifier with a precomputed kernel.
  • GraKeL’s design enables direct integration with scikit-learn’s pipeline, allowing users to combine graph kernels with standard ML algorithms like SVMs seamlessly.
  • The library’s object-oriented structure and scikit-learn compatibility make it easy to extend, compare, and benchmark new graph kernel designs.
  • Comprehensive documentation and public availability on GitHub under a BSD license foster community collaboration and reproducible research.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.