{"id":15029999,"url":"https://github.com/palash1992/gem","last_synced_at":"2025-04-08T13:02:36.700Z","repository":{"id":45797476,"uuid":"90606928","full_name":"palash1992/GEM","owner":"palash1992","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-05T22:04:24.000Z","size":28550,"stargazers_count":1284,"open_issues_count":14,"forks_count":361,"subscribers_count":42,"default_branch":"master","last_synced_at":"2025-04-01T12:00:15.141Z","etag":null,"topics":["graph-embedding","graph-embeddings","link-prediction","network-embedding","network-visualization"],"latest_commit_sha":null,"homepage":null,"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/palash1992.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":"2017-05-08T08:55:15.000Z","updated_at":"2025-03-05T21:53:56.000Z","dependencies_parsed_at":"2024-09-24T23:00:50.440Z","dependency_job_id":"60b24a24-4917-4090-9827-f05ceffd4374","html_url":"https://github.com/palash1992/GEM","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palash1992%2FGEM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palash1992%2FGEM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palash1992%2FGEM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palash1992%2FGEM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/palash1992","download_url":"https://codeload.github.com/palash1992/GEM/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246635959,"owners_count":20809332,"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-embedding","graph-embeddings","link-prediction","network-embedding","network-visualization"],"created_at":"2024-09-24T20:12:11.805Z","updated_at":"2025-04-01T12:01:06.332Z","avatar_url":"https://github.com/palash1992.png","language":"Python","readme":"[![Python application](https://github.com/jernsting/GEM/actions/workflows/lint_and_test.yml/badge.svg)](https://github.com/jernsting/GEM/actions/workflows/lint_and_test.yml)\n[![Coverage Status](https://coveralls.io/repos/github/jernsting/GEM/badge.svg?branch=master)](https://coveralls.io/github/jernsting/GEM?branch=master)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=jernsting_GEM\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=jernsting_GEM)\n\n# GEM: Graph Embedding Methods\nMany physical systems in the world involve interactions between different entities and can be represented as graphs. Understanding the structure and analyzing properties of graphs are hence paramount to developing insights into the physical systems. Graph embedding, which aims to represent a graph in a low dimensional vector space, takes a step in this direction. The embeddings can be used for various tasks on graphs such as visualization, clustering, classification and prediction.\n\n``GEM`` is a Python package which offers a general framework for graph embedding methods. It implements many state-of-the-art embedding techniques including [Locally Linear Embedding](http://www.robots.ox.ac.uk/~az/lectures/ml/lle.pdf), [Laplacian Eigenmaps](http://yeolab.weebly.com/uploads/2/5/5/0/25509700/belkin_laplacian_2003.pdf), [Graph Factorization](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/40839.pdf), [Higher-Order Proximity preserved Embedding (HOPE)](http://www.kdd.org/kdd2016/papers/files/rfp0184-ouA.pdf), [Structural Deep Network Embedding (SDNE)](http://www.kdd.org/kdd2016/papers/files/rfp0191-wangAemb.pdf) and [node2vec](http://www.kdd.org/kdd2016/papers/files/rfp0218-groverA.pdf). It is formatted such that new methods can be easily added for comparison. Furthermore, the framework implements several functions to evaluate the quality of obtained embedding including graph reconstruction, link prediction, visualization and node classification. It supports many edge reconstruction metrics including cosine similarity, euclidean distance and decoder based. For node classification, it defaults to one-vs-rest logistic regression classifier and supports other classifiers. For faster execution, C++ backend is integrated using Boost for supported methods. A paper showcasing the results using ``GEM`` on various real world datasets can be accessed through [Graph Embedding Techniques, Applications, and Performance: A Survey](https://arxiv.org/abs/1705.02801). The library is also published as [GEM: A Python package for graph embedding methods](https://doi.org/10.21105/joss.00876).\n\nPlease refer [https://palash1992.github.io/GEM/](https://palash1992.github.io/GEM/) to access the readme as a webpage.\n\n**Update**: Note that this is a library for static graph embedding methods. For evolving graph embedding methods, please refer [DynamicGEM](https://github.com/palash1992/DynamicGEM). We also recently released Youtube dynamic graph data set which can be found at [YoutubeGraph-Dyn](https://github.com/palash1992/YoutubeGraph-Dyn).\n\nThe module was developed and is maintained by Palash Goyal.\n\n## Implemented Methods\nGEM implements the following graph embedding techniques:\n* [Laplacian Eigenmaps](http://yeolab.weebly.com/uploads/2/5/5/0/25509700/belkin_laplacian_2003.pdf)\n* [Locally Linear Embedding](http://www.robots.ox.ac.uk/~az/lectures/ml/lle.pdf)\n* [Graph Factorization](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/40839.pdf)\n* [Higher-Order Proximity preserved Embedding (HOPE)](http://www.kdd.org/kdd2016/papers/files/rfp0184-ouA.pdf)\n* [Structural Deep Network Embedding (SDNE)](http://www.kdd.org/kdd2016/papers/files/rfp0191-wangAemb.pdf)\n* [node2vec](http://www.kdd.org/kdd2016/papers/files/rfp0218-groverA.pdf)\n\nA survey of these methods can be found in [Graph Embedding Techniques, Applications, and Performance: A Survey](https://arxiv.org/abs/1705.02801).\n\n## Graph Format\nWe store all graphs using the [DiGraph](http://networkx.readthedocs.io/en/networkx-1.11/reference/classes.digraph.html) as **directed weighted graph** in python package networkx. The weight of an edge is stored as attribute \"weight\". We save each edge in undirected graph as two directed edges.\n\nThe graphs are saved using `nx.write_gpickle` in the networkx format and can be loaded by using `nx.read_gpickle`.\n\n## Repository Structure\n* **gem/embedding**: existing approaches for graph embedding, where each method is a separate file\n* **gem/evaluation**: evaluation tasks for graph embedding, including graph reconstruction, link prediction, node classification and visualization\n* **gem/utils**: utility functions for graph manipulation, evaluation and etc.\n* **gem/data**: input test graph (currently has [Zachary's Karate graph](https://en.wikipedia.org/wiki/Zachary%27s_karate_club))\n* **gem/c_src**: source files for methods implemented in C++\n* **gem/c_ext**: Python interface for source files in c_src using [Boost.Python](http://www.boost.org/doc/libs/1_64_0/libs/python/doc/html/index.html)\n\n## Dependencies\nnxt_gem is tested to work on Python 3.9\n\nThe required dependencies are: Numpy \u003e= 1.12.0, SciPy \u003e= 0.19.0, Networkx \u003e= 2.4, Scikit-learn \u003e= 0.18.1.\n\nTo run SDNE, GEM requires Theano \u003e= 0.9.0 and tensorflow.\n\nIn case of Python 3, make sure it was compiled with `./configure --enable-shared`, and that you have `/usr/local/bin/python` in your `LD_LIBRARY_PATH`.\n\n## Install\nThe package uses setuptools, which is a common way of installing python modules. To install in your home directory, use:\n```bash\npython setup.py install --user\n```\n\nTo install for all users on Unix/Linux:\n```bash \nsudo python setup.py install\n```\n\nOr installing via pipwith git: \n```bash \npip install git+https://github.com/jernsting/nxt_gem.git\n```\n\n## Usage\nSee examples.\n\n## Cite\n    @article{goyal2017graph,\n        title = \"Graph embedding techniques, applications, and performance: A survey\",\n        journal = \"Knowledge-Based Systems\",\n        year = \"2018\",\n        issn = \"0950-7051\",\n        doi = \"https://doi.org/10.1016/j.knosys.2018.03.022\",\n        url = \"http://www.sciencedirect.com/science/article/pii/S0950705118301540\",\n        author = \"Palash Goyal and Emilio Ferrara\",\n        keywords = \"Graph embedding techniques, Graph embedding applications, Python graph embedding methods GEM library\"\n    }\n    @article{goyal3gem,\n      title={GEM: A Python package for graph embedding methods},\n      author={Goyal, Palash and Ferrara, Emilio},\n      journal={Journal of Open Source Software},\n      volume={3},\n      number={29},\n      pages={876}\n    }\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalash1992%2Fgem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpalash1992%2Fgem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalash1992%2Fgem/lists"}