{"id":21280613,"url":"https://github.com/borgwardtlab/filtration_curves","last_synced_at":"2026-02-27T01:04:50.060Z","repository":{"id":69455166,"uuid":"373524812","full_name":"BorgwardtLab/filtration_curves","owner":"BorgwardtLab","description":"Code for the KDD 2021 paper 'Filtration Curves for Graph Representation'","archived":false,"fork":false,"pushed_at":"2023-08-08T08:20:49.000Z","size":1194,"stargazers_count":18,"open_issues_count":0,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-06T06:45:03.041Z","etag":null,"topics":["graph-classification","graph-representation","kdd2021","topological-data-analysis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","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","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":"2021-06-03T13:53:29.000Z","updated_at":"2024-08-05T08:38:35.000Z","dependencies_parsed_at":"2024-11-21T10:47:25.305Z","dependency_job_id":null,"html_url":"https://github.com/BorgwardtLab/filtration_curves","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BorgwardtLab/filtration_curves","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2Ffiltration_curves","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2Ffiltration_curves/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2Ffiltration_curves/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2Ffiltration_curves/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BorgwardtLab","download_url":"https://codeload.github.com/BorgwardtLab/filtration_curves/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BorgwardtLab%2Ffiltration_curves/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29879922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T23:51:21.483Z","status":"ssl_error","status_checked_at":"2026-02-26T23:50:46.793Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-representation","kdd2021","topological-data-analysis"],"created_at":"2024-11-21T10:37:20.442Z","updated_at":"2026-02-27T01:04:50.032Z","avatar_url":"https://github.com/BorgwardtLab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Filtration Curves for Graph Representation\n\nThis repository provides the code from the KDD'21 paper *Filtration\nCurves for Graph Representation.* \n\n## Dependencies\n\nWe used [poetry](https://python-poetry.org/) to manage our dependencies.\nOnce poetry is installed on your computer, navigate to the directory\ncontaining this code and type `poetry install` which will install all of\nthe necessary dependencies (provided in the `pyproject.toml` file.\n\n## Data\n\nWe've provided sample data to work with to show how the method works out\nof the box, provided in the `data` folder. Our method works with graphs\nusing `igraph`, and requires that the graphs have an edge weight (e.g.,\nall weights in an `igraph` graph would be listed using the command `graph.es['weight']`. The BZR\\_MD dataset had edge weights already, and therefore we provided the original dataset; the MUTAG dataset did not have edge weights, so the data provided has edge weights added (using the Ricci curvature).\n\nIf your graphs do not have an edge weight, there are numerous ways to\ncalculate them, which we detail in the paper. An example of how we added edge weights can be found in the `preprocessing/label_edges.py` file. \n\n### How to run this on your own dataset\n\nTo test out our method on your own dataset, create a directory in the\n`data` folder with your dataset name, and store each individual graph as\nan `igraph` graph (with edge weights) as its own pickle file. Then you\ncan run the commands in the section below, replacing the name of the\ndataset with the name of the directory you created in the `data`\nfolder.\n\n## Method and Expected Output\n\nIn our work, we used two main graph descriptor functions: one using the node label histogram and one tracking the amount of connected components. There is a file for each; but please note that the node label histogram requires that the graph has node labels.\n\nTo run the node label histogram filtration curve, navigate to the `src`\nfolder and type the following command into the terminal:\n\n```bash\n$ poetry run python node_label_histogram_filtration_curve.py --dataset BZR_MD\n```\n\nThis should return the following result in the command line: `accuracy: 75.61 +- 1.13`.\n \nTo run the connected components filtration curve (using the Ricci\ncurvature), navigate to the `src`\nfolder and type the following command into the terminal:\n\n```bash\n$ poetry run python connected_components_filtration_curve.py --dataset MUTAG\n```\n\nThis should return the following result in the command line: `accuracy: 87.31 +- 0.66`.\n \n## Citing our work\n\nPlease use the following BibTeX citation when referencing our work:\n\n```bibtex\n@inproceedings{OBray21a,\n    title        = {Filtration Curves for Graph Representation},\n    author       = {O'Bray, Leslie and Rieck, Bastian and Borgwardt, Karsten},\n    doi          = {10.1145/3447548.3467442},\n    year         = 2021,\n    booktitle    = {Proceedings of the 27th ACM SIGKDD International\n                 Conference on Knowledge Discovery \\\u0026 Data Mining~(KDD)},\n    publisher    = {Association for Computing Machinery},\n    address      = {New York, NY, USA},\n    pubstate     = {inpress},\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborgwardtlab%2Ffiltration_curves","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborgwardtlab%2Ffiltration_curves","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborgwardtlab%2Ffiltration_curves/lists"}