From 424fe5fa322217407ecc68bbda8ad4f7be56c7eb Mon Sep 17 00:00:00 2001 From: jajupmochi Date: Fri, 25 Sep 2020 11:29:37 +0200 Subject: [PATCH 1/3] Update README.md --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 085084d..c9a0ca8 100644 --- a/README.md +++ b/README.md @@ -62,20 +62,20 @@ The docs of the library can be found [here](https://graphkit-learn.readthedocs.i ## Main contents -### List of graph kernels +### 1 List of graph kernels * Based on walks - * The common walk kernel [1] + * [The common walk kernel](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/common_walk.py) [1] * Exponential * Geometric * [The marginalized kenrel](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/marginalized.py) * With tottering [2] * Without tottering [7] - * The generalized random walk kernel [3] - * Sylvester equation + * [The generalized random walk kernel](gklearn/kernels/random_walk.py) [3] + * [Sylvester equation](gklearn/kernels/sylvester_equation.py) * Conjugate gradient * Fixed-point iterations - * Spectral decomposition + * [Spectral decomposition](gklearn/kernels/spectral_decomposition.py) * Based on paths * [The shortest path kernel](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/shortest_path.py) [4] * [The structural shortest path kernel](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/structural_sp.py) [5] @@ -89,17 +89,17 @@ The docs of the library can be found [here](https://graphkit-learn.readthedocs.i A demo of computing graph kernels can be found on [Google Colab](https://colab.research.google.com/drive/17Q2QCl9CAtDweGF8LiWnWoN2laeJqT0u?usp=sharing) and in the [`examples`](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/examples/compute_graph_kernel.py) folder. -### Graph Edit Distances +### 2 Graph Edit Distances -### Graph preimage methods +### 3 Graph preimage methods A demo of generating graph preimages can be found on [Google Colab](https://colab.research.google.com/drive/1PIDvHOcmiLEQ5Np3bgBDdu0kLOquOMQK?usp=sharing) and in the [`examples`](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/examples/median_preimege_generator.py) folder. -### Interface to `GEDLIB` +### 4 Interface to `GEDLIB` [`GEDLIB`](https://github.com/dbblumenthal/gedlib) is an easily extensible C++ library for (suboptimally) computing the graph edit distance between attributed graphs. [A Python interface](https://github.com/jajupmochi/graphkit-learn/tree/master/gklearn/gedlib) for `GEDLIB` is integrated in this library, based on [`gedlibpy`](https://github.com/Ryurin/gedlibpy) library. -### Computation optimization methods +### 5 Computation optimization methods * Python’s `multiprocessing.Pool` module is applied to perform **parallelization** on the computations of all kernels as well as the model selection. * **The Fast Computation of Shortest Path Kernel (FCSP) method** [8] is implemented in *the random walk kernel*, *the shortest path kernel*, as well as *the structural shortest path kernel* where FCSP is applied on both vertex and edge kernels. From 1b7d4adace9d100ce66a10e862743c7250e9e53a Mon Sep 17 00:00:00 2001 From: jajupmochi Date: Fri, 25 Sep 2020 11:32:56 +0200 Subject: [PATCH 2/3] Update README.md. --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c9a0ca8..62759a4 100644 --- a/README.md +++ b/README.md @@ -65,10 +65,10 @@ The docs of the library can be found [here](https://graphkit-learn.readthedocs.i ### 1 List of graph kernels * Based on walks - * [The common walk kernel](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/common_walk.py) [1] + * [The common walk kernel](gklearn/kernels/common_walk.py) [1] * Exponential * Geometric - * [The marginalized kenrel](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/marginalized.py) + * [The marginalized kenrel](gklearn/kernels/marginalized.py) * With tottering [2] * Without tottering [7] * [The generalized random walk kernel](gklearn/kernels/random_walk.py) [3] @@ -77,15 +77,15 @@ The docs of the library can be found [here](https://graphkit-learn.readthedocs.i * Fixed-point iterations * [Spectral decomposition](gklearn/kernels/spectral_decomposition.py) * Based on paths - * [The shortest path kernel](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/shortest_path.py) [4] - * [The structural shortest path kernel](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/structural_sp.py) [5] - * [The path kernel up to length h](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/path_up_to_h.py) [6] + * [The shortest path kernel](gklearn/kernels/shortest_path.py) [4] + * [The structural shortest path kernel](gklearn/kernels/structural_sp.py) [5] + * [The path kernel up to length h](gklearn/kernels/path_up_to_h.py) [6] * The Tanimoto kernel * The MinMax kernel * Non-linear kernels - * [The treelet kernel](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/treelet.py) [10] - * [Weisfeiler-Lehman kernel](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/weisfeiler_lehman.py) [11] - * [Subtree](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/kernels/weisfeiler_lehman.py#L479) + * [The treelet kernel](gklearn/kernels/treelet.py) [10] + * [Weisfeiler-Lehman kernel](gklearn/kernels/weisfeiler_lehman.py) [11] + * [Subtree](gklearn/kernels/weisfeiler_lehman.py#L479) A demo of computing graph kernels can be found on [Google Colab](https://colab.research.google.com/drive/17Q2QCl9CAtDweGF8LiWnWoN2laeJqT0u?usp=sharing) and in the [`examples`](https://github.com/jajupmochi/graphkit-learn/blob/master/gklearn/examples/compute_graph_kernel.py) folder. @@ -97,7 +97,7 @@ A demo of generating graph preimages can be found on [Google Colab](https://cola ### 4 Interface to `GEDLIB` -[`GEDLIB`](https://github.com/dbblumenthal/gedlib) is an easily extensible C++ library for (suboptimally) computing the graph edit distance between attributed graphs. [A Python interface](https://github.com/jajupmochi/graphkit-learn/tree/master/gklearn/gedlib) for `GEDLIB` is integrated in this library, based on [`gedlibpy`](https://github.com/Ryurin/gedlibpy) library. +[`GEDLIB`](https://github.com/dbblumenthal/gedlib) is an easily extensible C++ library for (suboptimally) computing the graph edit distance between attributed graphs. [A Python interface](gklearn/gedlib) for `GEDLIB` is integrated in this library, based on [`gedlibpy`](https://github.com/Ryurin/gedlibpy) library. ### 5 Computation optimization methods From 97257a5ef9a6d110ac18b274ccdad7946b6a86ed Mon Sep 17 00:00:00 2001 From: jajupmochi Date: Fri, 25 Sep 2020 11:47:30 +0200 Subject: [PATCH 3/3] Update namespace. --- gklearn/kernels/__init__.py | 10 ++++++++++ gklearn/utils/__init__.py | 1 + 2 files changed, 11 insertions(+) diff --git a/gklearn/kernels/__init__.py b/gklearn/kernels/__init__.py index c986891..7b15d70 100644 --- a/gklearn/kernels/__init__.py +++ b/gklearn/kernels/__init__.py @@ -18,3 +18,13 @@ from gklearn.kernels.structural_sp import StructuralSP from gklearn.kernels.path_up_to_h import PathUpToH from gklearn.kernels.treelet import Treelet from gklearn.kernels.weisfeiler_lehman import WeisfeilerLehman, WLSubtree + +# old version. +from gklearn.kernels.commonWalkKernel import commonwalkkernel +from gklearn.kernels.marginalizedKernel import marginalizedkernel +from gklearn.kernels.randomWalkKernel import randomwalkkernel +from gklearn.kernels.spKernel import spkernel +from gklearn.kernels.structuralspKernel import structuralspkernel +from gklearn.kernels.untilHPathKernel import untilhpathkernel +from gklearn.kernels.treeletKernel import treeletkernel +from gklearn.kernels.weisfeilerLehmanKernel import weisfeilerlehmankernel \ No newline at end of file diff --git a/gklearn/utils/__init__.py b/gklearn/utils/__init__.py index 149a3af..7c120f3 100644 --- a/gklearn/utils/__init__.py +++ b/gklearn/utils/__init__.py @@ -24,3 +24,4 @@ from gklearn.utils.utils import SpecialLabel, dummy_node, undefined_node, dummy_ from gklearn.utils.utils import normalize_gram_matrix, compute_distance_matrix from gklearn.utils.trie import Trie from gklearn.utils.knn import knn_cv, knn_classification +from gklearn.utils.model_selection_precomputed import model_selection_for_precomputed_kernel