{"id":13400380,"url":"https://github.com/phanein/deepwalk","last_synced_at":"2025-05-14T12:07:50.114Z","repository":{"id":19979872,"uuid":"23246978","full_name":"phanein/deepwalk","owner":"phanein","description":"DeepWalk - Deep Learning for Graphs","archived":false,"fork":false,"pushed_at":"2023-06-14T23:22:41.000Z","size":21784,"stargazers_count":2719,"open_issues_count":46,"forks_count":822,"subscribers_count":85,"default_branch":"master","last_synced_at":"2025-04-11T04:57:21.676Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.perozzi.net/projects/deepwalk/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phanein.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-08-23T03:38:20.000Z","updated_at":"2025-04-10T18:49:48.000Z","dependencies_parsed_at":"2023-01-13T20:42:33.723Z","dependency_job_id":"16af5fdb-92b4-4cce-a6b9-f901a556c59c","html_url":"https://github.com/phanein/deepwalk","commit_stats":{"total_commits":38,"total_committers":12,"mean_commits":"3.1666666666666665","dds":0.736842105263158,"last_synced_commit":"6e6dff245e4692e9bea47e9017c1034e51afbf29"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phanein%2Fdeepwalk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phanein%2Fdeepwalk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phanein%2Fdeepwalk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phanein%2Fdeepwalk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phanein","download_url":"https://codeload.github.com/phanein/deepwalk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254140749,"owners_count":22021219,"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":[],"created_at":"2024-07-30T19:00:51.396Z","updated_at":"2025-05-14T12:07:50.064Z","avatar_url":"https://github.com/phanein.png","language":"Python","funding_links":[],"categories":["Graph Embedding","Python","图数据处理","[Label Inference Methods](#content)","图嵌入、网络表征学习","Related Datasets Link"],"sub_categories":["Graph Embedding Approaches","网络服务_其他","**Other**"],"readme":"===============================\nDeepWalk\n===============================\n\nDeepWalk uses short random walks to learn representations for vertices in graphs.\n\nUsage\n-----\n\n**Example Usage**\n    ``$deepwalk --input example_graphs/karate.adjlist --output karate.embeddings``\n\n**--input**:  *input_filename*\n\n    1. ``--format adjlist`` for an adjacency list, e.g::\n\n        1 2 3 4 5 6 7 8 9 11 12 13 14 18 20 22 32\n        2 1 3 4 8 14 18 20 22 31\n        3 1 2 4 8 9 10 14 28 29 33\n        ...\n    \n    2. ``--format edgelist`` for an edge list, e.g::\n    \n        1 2\n        1 3\n        1 4\n        ...\n    \n    3. ``--format mat`` for a Matlab .mat file containing an adjacency matrix\n        (note, you must also specify the variable name of the adjacency matrix ``--matfile-variable-name``)\n\n**--output**: *output_filename*\n\n    The output representations in skipgram format - first line is header, all other lines are node-id and *d* dimensional representation::\n\n        34 64\n        1 0.016579 -0.033659 0.342167 -0.046998 ...\n        2 -0.007003 0.265891 -0.351422 0.043923 ...\n        ...\n\n**Full Command List**\n    The full list of command line options is available with ``$deepwalk --help``\n\nEvaluation\n----------\nHere, we will show how to evaluate DeepWalk on the *BlogCatalog* dataset used in the DeepWalk paper.\nFirst, we run the following command to produce its DeepWalk embeddings::\n\n    deepwalk --format mat --input example_graphs/blogcatalog.mat\n    --max-memory-data-size 0 --number-walks 80 --representation-size 128 --walk-length 40 --window-size 10\n    --workers 1 --output example_graphs/blogcatalog.embeddings\n\nThe parameters specified here are the same as in the paper.\nIf you are using a multi-core machine, try to set ``--workers`` to a larger number for faster training.\nOn a single machine with 24 Xeon E5-2620 @ 2.00GHz CPUs, this command takes about 20 minutes to finish (``--workers`` is set to 20).\nThen, we evaluate the learned embeddings on a multi-label node classification task with ``example_graphs/scoring.py``::\n\n    python example_graphs/scoring.py --emb example_graphs/blogcatalog.embeddings\n    --network example_graphs/blogcatalog.mat\n    --num-shuffle 10 --all\n\nThis command finishes in 8 minutes on the same machine. For faster evaluation, you can set ``--num-shuffle`` to a smaller number, but expect more fluctuation in performance. The micro F1 and macro F1 scores we get with different ratio of labeled nodes are as follows:\n\n+-----------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+\n| % Labeled Nodes | 10%   | 20%   | 30%   | 40%   | 50%   | 60%   | 70%   | 80%   | 90%   |\n+=================+=======+=======+=======+=======+=======+=======+=======+=======+=======+\n| *Micro-F1 (%)*  | 35.86 | 38.51 | 39.96 | 40.76 | 41.51 | 41.85 | 42.27 | 42.35 | 42.40 |\n+-----------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+\n| *Macro-F1 (%)*  | 21.08 | 23.98 | 25.71 | 26.73 | 27.68 | 28.28 | 28.88 | 28.70 | 28.21 |\n+-----------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+\n\n**Note that the current version of DeepWalk is based on a newer version of gensim, which may have a different implementation of the word2vec model. To completely reproduce the results in our paper, you will probably have to install an older version of gensim(version 0.10.2).**\n\nRequirements\n------------\n* numpy\n* scipy\n\n(may have to be independently installed) \nor `pip install -r requirements.txt` to install all dependencies\n\n\nInstallation\n------------\n1. `cd deepwalk`\n2. `pip install -r requirements.txt`\n3. `python setup.py install`\n\n\nCiting\n------\nIf you find DeepWalk useful in your research, we ask that you cite the following paper::\n\n    @inproceedings{Perozzi:2014:DOL:2623330.2623732,\n     author = {Perozzi, Bryan and Al-Rfou, Rami and Skiena, Steven},\n     title = {DeepWalk: Online Learning of Social Representations},\n     booktitle = {Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining},\n     series = {KDD '14},\n     year = {2014},\n     isbn = {978-1-4503-2956-9},\n     location = {New York, New York, USA},\n     pages = {701--710},\n     numpages = {10},\n     url = {http://doi.acm.org/10.1145/2623330.2623732},\n     doi = {10.1145/2623330.2623732},\n     acmid = {2623732},\n     publisher = {ACM},\n     address = {New York, NY, USA},\n     keywords = {deep learning, latent representations, learning with partial labels, network classification, online learning, social networks},\n    } \n\nMisc\n----\n\nDeepWalk - Online learning of social representations.\n\n* Free software: GPLv3 license\n\n.. image:: https://badge.fury.io/py/deepwalk.png\n    :target: http://badge.fury.io/py/deepwalk\n\n.. image:: https://travis-ci.org/phanein/deepwalk.png?branch=master\n        :target: https://travis-ci.org/phanein/deepwalk\n\n.. image:: https://pypip.in/d/deepwalk/badge.png\n        :target: https://pypi.python.org/pypi/deepwalk\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphanein%2Fdeepwalk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphanein%2Fdeepwalk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphanein%2Fdeepwalk/lists"}