{"id":20307871,"url":"https://github.com/benedekrozemberczki/boostedfactorization","last_synced_at":"2025-08-21T03:05:56.315Z","repository":{"id":102016337,"uuid":"147327025","full_name":"benedekrozemberczki/BoostedFactorization","owner":"benedekrozemberczki","description":"An implementation of \"Multi-Level Network Embedding with Boosted Low-Rank Matrix Approximation\" (ASONAM 2019).","archived":false,"fork":false,"pushed_at":"2022-09-19T18:35:02.000Z","size":849,"stargazers_count":36,"open_issues_count":0,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-30T14:05:11.969Z","etag":null,"topics":["boostedne","boosting","boosting-machine","data-mining","deepwalk","dimensionality-reduction","factorization-machine","gradient-boosting","gradient-boosting-machine","l-ensnmf","machine-learning","matrix-factorization","network-embedding","nmf","nmf-decomposition","node-embedding","node2vec","sklearn","unsupervised-learning","word2vec"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","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":".github/FUNDING.yml","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},"funding":{"github":["benedekrozemberczki"]}},"created_at":"2018-09-04T10:11:16.000Z","updated_at":"2024-12-15T08:14:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"5c09dfb6-61ed-4772-9d82-8428e0d99f51","html_url":"https://github.com/benedekrozemberczki/BoostedFactorization","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/benedekrozemberczki/BoostedFactorization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedekrozemberczki%2FBoostedFactorization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedekrozemberczki%2FBoostedFactorization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedekrozemberczki%2FBoostedFactorization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedekrozemberczki%2FBoostedFactorization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benedekrozemberczki","download_url":"https://codeload.github.com/benedekrozemberczki/BoostedFactorization/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benedekrozemberczki%2FBoostedFactorization/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271420131,"owners_count":24756490,"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","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["boostedne","boosting","boosting-machine","data-mining","deepwalk","dimensionality-reduction","factorization-machine","gradient-boosting","gradient-boosting-machine","l-ensnmf","machine-learning","matrix-factorization","network-embedding","nmf","nmf-decomposition","node-embedding","node2vec","sklearn","unsupervised-learning","word2vec"],"created_at":"2024-11-14T17:19:25.128Z","updated_at":"2025-08-21T03:05:56.299Z","avatar_url":"https://github.com/benedekrozemberczki.png","language":"Python","funding_links":["https://github.com/sponsors/benedekrozemberczki"],"categories":[],"sub_categories":[],"readme":"L-EnsNMF and BoostedNE\n==================\n[![Arxiv](https://img.shields.io/badge/ArXiv-1808.08627-orange.svg)](https://arxiv.org/abs/1808.08627) [![codebeat badge](https://codebeat.co/badges/19d86143-629a-474f-87f2-6e78d9f8fc62)](https://codebeat.co/projects/github-com-benedekrozemberczki-boostedfactorization-master) [![repo size](https://img.shields.io/github/repo-size/benedekrozemberczki/BoostedFactorization.svg)](https://github.com/benedekrozemberczki/BoostedFactorization/archive/master.zip)⠀[![benedekrozemberczki](https://img.shields.io/twitter/follow/benrozemberczki?style=social\u0026logo=twitter)](https://twitter.com/intent/follow?screen_name=benrozemberczki)\n\n\u003cp align=\"justify\"\u003e\nThe factorization procedure L-EnsNMF creates a sequential ensemble factorization of a target matrix. In each factorization round a residual target matrix is created by sampling an anchor row and column. Anchor sampling finds a block of matrix entries that are similar to the row and column and other entries of the residual matrix are downsampled. By factorizing the residuals matrices each relatively upsampled block gets a high quality representation. BoostNE adapts this idea for node embedding. An approximate target matrix obtained with truncated random walk sampling is factorized by the L-EnsNMF method. This way blocks of highly connected nodes get representations that are described by vectors obtained in a given boosting round. Specifically, my implementation assumes that the target matrices are sparse. So far this is the only publicly available Python implementation of these procedures.\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"800\" src=\"boosting.png\"\u003e\n\u003c/p\u003e\n\nThe model is now also available in the package [Karate Club](https://github.com/benedekrozemberczki/karateclub).\n\nThis repository provides an implementation for L-EnsNMF and BoostedNE as described in the papers:\n\n\u003e **L-EnsNMF: Boosted Local Topic Discovery via Ensemble of Nonnegative Matrix Factorization.**\n\u003e Sangho Suh, Jaegul Choo, Joonseok Lee, Chandan K. Reddy\n\u003e ICDM, 2016.\n\u003e http://dmkd.cs.vt.edu/papers/ICDM16.pdf\n\n\u003e **Multi-Level Network Embedding with Boosted Low-Rank Matrix Approximation.**\n\u003e Jundong Li, Liang Wu and Huan Liu\n\u003e ASONAM, 2019.\n\u003e https://arxiv.org/abs/1808.08627\n\nThe original Matlab implementation is available [[here]](https://github.com/sanghosuh/lens_nmf-matlab).\n\n### Requirements\n\nThe codebase is implemented in Python 3.5.2. The 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\nsklearn           0.19.1\n```\n\n### Datasets\n\n#### Graphs\n\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. A sample graph for the `Wikipedia Giraffes` is included in the `input/` directory.\n\n#### Sparse Matrices\n\nThe code takes an input matrix in a csv file. Every row indicates a (user,item,score) separated by a comma. The first row is a header. Users and items should be indexed starting with 0, each score is positive. A sample sparse stochastic block matrix is included in the  `input/` folder.\n\n### Options\n\nLearning of 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```\n  --input-path    STR      Edges path.                        Default is `input/giraffe_edges.csv`.\n  --output-path   STR      Embedding path.                    Default is `output/giraffe_embedding.csv`.\n  --dataset-type  STR      Whether the dataset is a graph.    Default is `graph`.  \n```\n\n#### Boosted Model options\n\n```\n  --dimensions   INT         Number of embeding dimensions.   Default is 8.\n  --iterations   INT         Number of power interations.     Default is 10.\n  --alpha        FLOAT       Regularization coefficient.      Default is 0.001.\n```\n\n#### DeepWalk options\n\n```\n  --number-of-walks     INT      Number of random walks.                  Default is 10.\n  --walk-length         INT      Random walk length.                      Default is 80.\n  --window-size         INT      Window size for feature extractions.     Default is 3.\n  --pruning-threshold   INT      Minimal co-occurence count to be kept.   Default is 10.\n```\n\n### Examples\n\nThe following commands learn a graph embedding and write the embedding to disk. The node representations are ordered by the ID.\n\nCreating an embedding of the default dataset with the default hyperparameter settings. Saving the embedding at the default path.\n\n```sh\n$ python src/main.py\n```\nCreating an embedding of the default dataset with 16 dimensions and 20 boosting rounds. This results in a 16x20=320 dimensional embedding.\n\n```sh\n$ python src/main.py --dimensions 16 --iterations 20\n```\n\nCreating an Lens-NMF embedding of the default dataset with stronger regularization.\n\n```sh\n$ python src/main.py --alpha 0.1\n```\n\nCreating an embedding of an other dataset the `Wikipedia Dogs`. Saving the output in a custom folder.\n\n```sh\n$ python src/main.py --input-path input/dog_edges.csv --output-path output/dog_lensnmf.csv\n```\n\nCreating an embedding of the default dataset with 20 random walks per source and 120 nodes in each vertex sequence.\n\n```sh\n$ python src/main.py --walk-length 120 --number-of-walks 20\n```\n\nCreating an embedding of a non-graph dataset and storing it under a non-standard name.\n\n```sh\n$ python src/main.py --dataset-type sparse --input-path input/small_block.csv --output-path output/block_embedding.csv\n```\n\n------------------------------------------------------\n\n**License**\n\n- [GNU License](https://github.com/benedekrozemberczki/BoostedFactorization/blob/master/LICENSE)\n\n--------------------------------------------------------------------------------\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenedekrozemberczki%2Fboostedfactorization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenedekrozemberczki%2Fboostedfactorization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenedekrozemberczki%2Fboostedfactorization/lists"}