{"id":21280618,"url":"https://github.com/borgwardtlab/p-wl","last_synced_at":"2025-07-11T10:32:34.489Z","repository":{"id":69455290,"uuid":"154287123","full_name":"BorgwardtLab/P-WL","owner":"BorgwardtLab","description":"A Persistent Weisfeiler–Lehman Procedure for Graph Classification","archived":false,"fork":false,"pushed_at":"2021-06-09T20:26:25.000Z","size":170515,"stargazers_count":60,"open_issues_count":0,"forks_count":17,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-30T15:50:43.670Z","etag":null,"topics":["graph-classification","graph-kernels","machine-learning","persistent-homology","topological-data-analysis","weisfeiler-lehman"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BorgwardtLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-23T08:00:08.000Z","updated_at":"2024-07-23T17:17:35.000Z","dependencies_parsed_at":"2023-02-27T16:32:47.419Z","dependency_job_id":null,"html_url":"https://github.com/BorgwardtLab/P-WL","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2FP-WL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2FP-WL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2FP-WL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2FP-WL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BorgwardtLab","download_url":"https://codeload.github.com/BorgwardtLab/P-WL/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225715507,"owners_count":17512902,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graph-classification","graph-kernels","machine-learning","persistent-homology","topological-data-analysis","weisfeiler-lehman"],"created_at":"2024-11-21T10:37:22.085Z","updated_at":"2024-11-21T10:37:22.557Z","avatar_url":"https://github.com/BorgwardtLab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Persistent Weisfeiler\u0026ndash;Lehman Procedure for Graph Classification\n\nThis repository contains code, data sets, experiments, and documentation\nfor our ICML 2019 paper\n\u0026ldquo;[A Persistent Weisfeiler\u0026ndash;Lehman Procedure for Graph Classification](http://proceedings.mlr.press/v97/rieck19a/rieck19a.pdf)\u0026rdquo;.\n\n![Workflow of the persistent Weisfeiler--Lehman procedure][logo]\n\n[logo]: https://github.com/BorgwardtLab/P-WL/blob/master/assets/flow.png \"Workflow of the persitent Weisfeiler--Lehman procedure\"\n\n## Running the Method\n\n**Warning**: The classification accuracies reported by running this code\nwill not\u0026nbsp;(!) align with the ones reported in the paper, as no grid\nsearch is performed. Thus, the folds used for training will be slightly\ndifferent because there is no inner cross-validation loop.\n\n## Examples\n\nTo run `PWL-C` on `MUTAG` with 0 WL iterations and p=1, run \n```\n$ cd src\n$ python main.py -c -n 0 -p 1 ../data/MUTAG/*.gml -l ../data/MUTAG/Labels.txt\n```\n\nThe arguments for all our methods (with `1 WL iteration` and `p=1`) are as follows:\n\n`PWL`: `main.py -n 1 -p 1 ../data/...`\n\n`PWL-C`: `main.py -c -n 1 -p 1 ../data/...`\n\n`PWL-UC`: `main.py -u -c -n 1 -p 1 ../data/...`\n\n## Results\n\nThese are the results reported in the paper. For convenience reasons, we\nsummarise them here. This table will be updated as soon as other baselines\nare available.\n\n|             | D \u0026 D        | MUTAG        | NCI1         | NCI109       | PROTEINS     | PTC-MR       | PTC-FR       | PTC-MM       | PTC-FM       | \n|-------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------|--------------| \n| V-Hist      | 78.32 ± 0.35 | 85.96 ± 0.27 | 64.40 ± 0.07 | 63.25 ± 0.12 | 72.33 ± 0.32 | 58.31 ± 0.27 | **68.13 ± 0.23** | 66.96 ± 0.51 | 57.91 ± 0.83 | \n| E-Hist      | 72.90 ± 0.48 | 85.69 ± 0.46 | 63.66 ± 0.11 | 63.27 ± 0.07 | 72.14 ± 0.39 | 55.82 ± 0.00 | 65.53 ± 0.00 | 61.61 ± 0.00 | 59.03 ± 0.00 | \n| RETGK   | **81.60 ± 0.30** | 90.30 ± 1.10 | 84.50 ± 0.20 |              | 75.80 ± 0.60 | 62.15 ± 1.60 | 67.80 ± 1.10 | 67.90 ± 1.40 | 63.90 ± 1.30 | \n| WL          | 79.45 ± 0.38 | 87.26 ± 1.42 | 85.58 ± 0.15 | 84.85 ± 0.19 | **76.11 ± 0.64** | 63.12 ± 1.44 | 67.64 ± 0.74 | 67.28 ± 0.97 | 64.80 ± 0.85 | \n| DEEP-WL |              | 82.94 ± 2.68 | 80.31 ± 0.46 | 80.32 ± 0.33 | 75.68 ± 0.54 | 60.08 ± 2.55 |              |              |              | \n| P-WL        | 79.34 ± 0.46 | 86.10 ± 1.37 | 85.34 ± 0.14 | 84.78 ± 0.15 | 75.31 ± 0.73 | 63.07 ± 1.68 | 67.30 ± 1.50 | **68.40 ± 1.17** | 64.47 ± 1.84 | \n| P-WL-C      | 78.66 ± 0.32 | **90.51 ± 1.34** | 85.46 ± 0.16 | **84.96 ± 0.34** | 75.27 ± 0.38 | **64.02 ± 0.82** | 67.15 ± 1.09 | **68.57 ± 1.76** | **65.78 ± 1.22** | \n| P-WL-UC     | 78.50 ± 0.41 | 85.17 ± 0.29 | **85.62 ± 0.27** | **85.11 ± 0.30** | 75.86 ± 0.78 | **63.46 ± 1.58**| 67.02 ± 1.29 | **68.01 ± 1.04** | **65.44 ± 1.18** | \n\n## Additional experiments\n\nThe repository contains additional experiments, which will be documented\nand extended over time:\n\n- Accuracy per iteration step of `WL` vs. `P-WL` vs. `P-WL-C`\n- Feature importance of cycle features (forthcoming)\n- Kullback\u0026ndash;Leibler divergence and Jensen\u0026ndash;Shannon divergence\n- Comparison with additional baselines and graph kernels\u0026nbsp;(see also\n  the [GraphKernels repository](https://github.com/BorgwardtLab/GraphKernels)\n  for more of them)\n\n## Help\n\nIf you have questions concerning P-WL or you encounter problems when\ntrying to build the tool under your own system, please open an issue in\n[the issue tracker](https://github.com/BorgwardtLab/P-WL/issues). Try to\ndescribe the issue in sufficient detail in order to make it possible for\nus to help you.\n\n## Contributors\n\nP-WL is developed and maintained by members of the [Machine Learning and\nComputational Biology Lab](https://www.bsse.ethz.ch/mlcb) of [Prof. Dr.\nKarsten Borgwardt](https://www.bsse.ethz.ch/mlcb/karsten.html):\n\n- Bastian Rieck ([GitHub](https://github.com/Submanifold))\n- Christian Bock ([GitHub](https://github.com/chrisby))\n\n## Citation \n\nPlease use the following BibTeX citation when using our method or\ncomparing against it:\n\n    @InProceedings{Rieck19b,\n      title     = {A Persistent {W}eisfeiler--{L}ehman Procedure for Graph Classification},\n      author    = {Rieck, Bastian and Bock, Christian and Borgwardt, Karsten},\n      booktitle = {Proceedings of the 36th International Conference on Machine Learning},\n      pages     = {5448--5458},\n      year      = {2019},\n      editor    = {Chaudhuri, Kamalika and Salakhutdinov, Ruslan},\n      volume    = {97},\n      series    = {Proceedings of Machine Learning Research},\n      address   = {Long Beach, California, USA},\n      month     = jun,\n      publisher = {PMLR},\n      pdf       = {http://proceedings.mlr.press/v97/rieck19a/rieck19a.pdf},\n      url       = {http://proceedings.mlr.press/v97/rieck19a.html},\n      abstract  = {The Weisfeiler–-Lehman graph kernel exhibits competitive performance in many graph classification tasks. However, its subtree features are not able to capture connected components and cycles, topological features known for characterising graphs. To extract such features, we leverage propagated node label information and transform unweighted graphs into metric ones. This permits us to augment the subtree features with topological information obtained using persistent homology, a concept from topological data analysis. Our method, which we formalise as a generalisation of Weisfeiler-–Lehman subtree features, exhibits favourable classification accuracy and its improvements in predictive performance are mainly driven by including cycle information.}\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborgwardtlab%2Fp-wl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborgwardtlab%2Fp-wl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborgwardtlab%2Fp-wl/lists"}