{"id":20307890,"url":"https://github.com/benedekrozemberczki/feather","last_synced_at":"2025-04-11T15:12:50.416Z","repository":{"id":102016421,"uuid":"241165262","full_name":"benedekrozemberczki/FEATHER","owner":"benedekrozemberczki","description":"The reference implementation of FEATHER from the CIKM '20 paper \"Characteristic Functions on Graphs: Birds of a Feather, from Statistical Descriptors to Parametric Models\".","archived":false,"fork":false,"pushed_at":"2023-03-18T12:13:01.000Z","size":14955,"stargazers_count":50,"open_issues_count":1,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T11:21:34.723Z","etag":null,"topics":["data-mining","deep-learning","deep-neural-networks","deepwalk","graph","graph-classification","graph-convolution","graph-embedding","graph-kernel","graph2vec","machine-learning","network-embedding","networkx","neural-network","node-classification","node-embedding","node2vec","pytorch","representation-learning","tensorflow"],"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/benedekrozemberczki.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":"2020-02-17T17:17:04.000Z","updated_at":"2025-03-09T13:28:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"0b1aefc9-a40d-4db0-a2ef-6af646bb51af","html_url":"https://github.com/benedekrozemberczki/FEATHER","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/benedekrozemberczki%2FFEATHER","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedekrozemberczki%2FFEATHER/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedekrozemberczki%2FFEATHER/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedekrozemberczki%2FFEATHER/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benedekrozemberczki","download_url":"https://codeload.github.com/benedekrozemberczki/FEATHER/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248429119,"owners_count":21101785,"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":["data-mining","deep-learning","deep-neural-networks","deepwalk","graph","graph-classification","graph-convolution","graph-embedding","graph-kernel","graph2vec","machine-learning","network-embedding","networkx","neural-network","node-classification","node-embedding","node2vec","pytorch","representation-learning","tensorflow"],"created_at":"2024-11-14T17:19:35.476Z","updated_at":"2025-04-11T15:12:50.388Z","avatar_url":"https://github.com/benedekrozemberczki.png","language":"Python","readme":"FEATHER \n==========================\n[![Arxiv](https://img.shields.io/badge/ArXiv-2005.07959-orange.svg)](https://arxiv.org/abs/2005.07959) [![codebeat badge](https://codebeat.co/badges/6f53b1a1-71d2-453e-a59c-91c75f9ea3c3)](https://codebeat.co/projects/github-com-benedekrozemberczki-feather-master) [![repo size](https://img.shields.io/github/repo-size/benedekrozemberczki/FEATHER.svg)](https://github.com/benedekrozemberczki/FEATHER/archive/master.zip) [![benedekrozemberczki](https://img.shields.io/twitter/follow/benrozemberczki?style=social\u0026logo=twitter)](https://twitter.com/intent/follow?screen_name=benrozemberczki)\n\nThe Python reference implementation of **FEATHER** and **FEATHER-G** from the **CIKM '20** paper **Characteristic Functions on Graphs: Birds of a Feather, from Statistical Descriptors to Parametric Models.**\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"600\" src=\"charfun.jpg\"\u003e\n\u003c/p\u003e\n\n---------------------\n\n### Abstract\n\n\u003cp align=\"justify\"\u003e\nIn this paper, we propose a flexible notion of characteristic functions defined on graph vertices to describe the distribution of vertex features at multiple scales. We introduce FEATHER, a computationally efficient algorithm to calculate a specific variant of these characteristic functions where the probability weights of the characteristic function are defined as the transition probabilities of random walks. We argue that features extracted by this procedure are useful for node level machine learning tasks. We discuss the pooling of these node representations, resulting in compact descriptors of graphs that can serve as features for graph classification algorithms. We analytically prove that FEATHER describes isomorphic graphs with the same representation and exhibits robustness to data corruption. Using the node feature characteristic functions we define parametric models where evaluation points of the functions are learned parameters of supervised classifiers. Experiments on real world large datasets show that our proposed algorithm creates high quality representations, performs transfer learning efficiently, exhibits robustness to hyperparameter changes, and scales linearly with the input size.\u003c/p\u003e\n\nThis repository provides the reference implementation for FEATHER as described in the paper:\n\u003e Characteristic Functions on Graphs: Birds of a Feather, from Statistical Descriptors to Parametric Models.\n\u003e [Benedek Rozemberczki](http://homepages.inf.ed.ac.uk/s1668259/) and [Rik Sarkar](https://homepages.inf.ed.ac.uk/rsarkar/).\n\u003e CIKM, 2020.\n\nThe datasets are also available on [SNAP](http://snap.stanford.edu/).\n\nThe model is now also available in the package [Karate Club](https://github.com/benedekrozemberczki/karateclub).\n\n### Table of Contents\n\n1. [Citing](#citing)  \n2. [Requirements](#requirements)\n3. [Options](#options) \n4. [Examples](#examples)\n\n### Citing\n\nIf you find FEATHER useful in your research, please consider citing the following paper:\n```bibtex\n@inproceedings{feather,\n               title={{Characteristic Functions on Graphs: Birds of a Feather, from Statistical Descriptors to Parametric Models}},\n               author={Benedek Rozemberczki and Rik Sarkar},\n               year={2020},\n\t       pages = {1325–1334},\n\t       booktitle={Proceedings of the 29th ACM International Conference on Information and Knowledge Management (CIKM '20)},\n\t       organization={ACM},\n}\n```\n\n### Requirements\nThe codebase is implemented in Python 3.5.2. package versions used for development are just below.\n```\nnetworkx          2.4\ntqdm              4.28.1\nnumpy             1.15.4\npandas            0.23.4\ntexttable         1.5.0\nscipy             1.1.0\nargparse          1.1.0\n```\n\n### Input\n\n#### Node level\n\n\u003cp align=\"justify\"\u003e\nThe code takes an input graph in a csv file. Every row indicates an edge between two nodes separated by a comma. The first row is a header. Nodes should be indexed starting with 0. \u003c/p\u003e\n\nThe feature matrix is **dense** it is assumed that it is stored as csv with comma separators. It has a header, and rows are separated by node identifiers (increasing). It should look like this:\n\n| **Feature 1** | **Feature 2** | **Feature 3** | **Feature 4** |\n| --- | --- | --- |--- |\n| 3 |0 |1.37 |1 |\n| 1 |1 |2.54 |-11 |\n| 2 |0 |1.08 |-12 |\n| 1 |1 |1.22 |-4 |\n| ... |... |... |... |\n| 5 |0 |2.47 |21 |\n\n#### Graph level\n\nThe graphs are stored in a JSON file where keys are graph identifiers and values are edge lists. Graph identifiers are consecutive and start with 0. Each individual graph has nodes which are indexed starting with 0. We assume that graphs are connected. \n\n```javascript\n{ 0: [[0, 1], [1, 2], [2, 3]],\n  1: [[0, 1], [1, 2], [2, 0]],\n  ...\n  n: [[0, 1], [1, 2]]}\n```\n\n### Options\n\nLearning the embedding is handled by the `src/main.py` script which provides the following command line arguments.\n\n#### Input and output options\n```\n  --graph-input      STR   Input edge list csv.      Default is `input/edges/ER_edges.csv`.\n  --feature-input    STR   Input features csv.       Default is `input/features/ER_features.csv`.\n  --graphs           STR   Input graphs json.        Default is `input/graphs/ER_graphs.json`.\n  --output           STR   Embedding output path.    Default is `output/ER_node_embedding.csv`.\n```\n#### Model options\n```\n  --model-type    STR      FEATHER or FEATHER-G model.          Default is  `FEATHER`.\n  --eval-points   INT      Number of evaluation points.         Default is  25.\n  --order         INT      Matrix powers approximated.          Default is  5.\n  --theta-max     FLOAT    Length of random walk per source.    Default is  2.5.\n```\n\n### Examples\nTraining a FEATHER model.\n```sh\n$ python src/main.py\n```\n\nChanging the scale parameter to increase adjacency matrix powers.\n```sh\n$ python src/main.py --order 3\n```\n\nDecreasing the number of evaluation points.\n```sh\n$ python src/main.py --eval-points 25\n```\n\nTraining a graph level FEATHER model with the default dataset.\n```sh\n$ python src/main.py --model-type FEATHER-G --output output/ER_graph_embedding.csv\n```\n--------------------------------------------------------------------------------\n\n**License**\n\n- [MIT](https://github.com/benedekrozemberczki/FEATHER/blob/master/LICENSE)\n\n--------------------------------------------------------------------------------\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenedekrozemberczki%2Ffeather","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenedekrozemberczki%2Ffeather","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenedekrozemberczki%2Ffeather/lists"}