{"id":26686402,"url":"https://github.com/convexfi/spectralgraphtopology","last_synced_at":"2025-04-12T16:52:44.198Z","repository":{"id":45788788,"uuid":"144129818","full_name":"convexfi/spectralGraphTopology","owner":"convexfi","description":"Structured Graph Learning via Laplacian Spectral Constraints (NeurIPS 2019)","archived":false,"fork":false,"pushed_at":"2022-09-26T06:52:13.000Z","size":142875,"stargazers_count":59,"open_issues_count":4,"forks_count":17,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-26T11:18:05.799Z","etag":null,"topics":["clustering","machine-learning"],"latest_commit_sha":null,"homepage":"https://CRAN.R-project.org/package=spectralGraphTopology","language":"R","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/convexfi.png","metadata":{"files":{"readme":"README.Rmd","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}},"created_at":"2018-08-09T09:19:53.000Z","updated_at":"2024-07-14T10:26:45.000Z","dependencies_parsed_at":"2022-07-17T00:46:04.332Z","dependency_job_id":null,"html_url":"https://github.com/convexfi/spectralGraphTopology","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/convexfi%2FspectralGraphTopology","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/convexfi%2FspectralGraphTopology/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/convexfi%2FspectralGraphTopology/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/convexfi%2FspectralGraphTopology/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/convexfi","download_url":"https://codeload.github.com/convexfi/spectralGraphTopology/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248601310,"owners_count":21131608,"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":["clustering","machine-learning"],"created_at":"2025-03-26T11:18:12.630Z","updated_at":"2025-04-12T16:52:44.178Z","avatar_url":"https://github.com/convexfi.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: \"spectralGraphTopology\"\noutput:\n  md_document:\n    variant: markdown_github\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nlibrary(knitr)\nopts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  fig.align = \"center\",\n  fig.retina = 2,\n  out.width = \"75%\",\n  dpi = 96\n)\nknit_hooks$set(pngquant = hook_pngquant)\n```\n\n# spectralGraphTopology\n\n[![codecov](https://codecov.io/gh/mirca/spectralGraphTopology/branch/master/graph/badge.svg?token=0FlrfUz3pg)](https://app.codecov.io/gh/mirca/spectralGraphTopology)\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/spectralGraphTopology)](https://cran.r-project.org/package=spectralGraphTopology)\n[![CRAN Downloads](https://cranlogs.r-pkg.org/badges/spectralGraphTopology)](https://cran.r-project.org/package=spectralGraphTopology)\n![CRAN Downloads Total](https://cranlogs.r-pkg.org/badges/grand-total/spectralGraphTopology?color=brightgreen)\n[![Rcpp](https://img.shields.io/badge/powered%20by-Rcpp-orange.svg?style=flat)](http://www.rcpp.org/)\n\n\n\u003ca href=\"https://mirca.github.io/spectralGraphTopology/\"\u003e\u003cimg style=\"float: right;\" width=\"250\" src=\"./man/figures//circles3_reduced.gif\" align=\"right\" /\u003e\u003c/a\u003e\n\n**spectralGraphTopology** provides estimators to learn k-component, bipartite,\nand k-component bipartite graphs from data by imposing spectral constraints\non the eigenvalues and eigenvectors of the Laplacian and adjacency matrices.\nThose estimators leverage spectral properties of the graphical models as a\nprior information which turn out to play key roles in unsupervised machine\nlearning tasks such as clustering.\n\n**Documentation**: [**https://mirca.github.io/spectralGraphTopology**](https://mirca.github.io/spectralGraphTopology/).\n\n## Installation\n\nFrom inside an R session, type:\n```{r, eval = FALSE}\n\u003e install.packages(\"spectralGraphTopology\")\n```\n\nAlternatively, you can install the development version from GitHub:\n```{r, eval = FALSE}\n\u003e devtools::install_github(\"dppalomar/spectralGraphTopology\")\n```\n\n#### Microsoft Windows\nOn MS Windows environments, make sure to install the most recent version of ``Rtools``.\n\n#### macOS\n**spectralGraphTopology** depends on [`RcppArmadillo`](https://github.com/RcppCore/RcppArmadillo)\nwhich requires [`gfortran`](https://CRAN.R-project.org/bin/macosx/tools/).\n\n## Usage: clustering\nWe illustrate the usage of the package with simulated data, as follows:\n```{r plot_k_component, message=FALSE}\nlibrary(spectralGraphTopology)\nlibrary(clusterSim)\nlibrary(igraph)\nset.seed(42)\n\n# generate graph and data\nn \u003c- 50  # number of nodes per cluster\ntwomoon \u003c- clusterSim::shapes.two.moon(n)  # generate data points\nk \u003c- 2  # number of components\n\n# estimate underlying graph\nS \u003c- crossprod(t(twomoon$data))\ngraph \u003c- learn_k_component_graph(S, k = k, beta = .25, verbose = FALSE, abstol = 1e-3)\n\n# plot\n# build network\nnet \u003c- igraph::graph_from_adjacency_matrix(graph$adjacency, mode = \"undirected\", weighted = TRUE)\n# colorify nodes and edges\ncolors \u003c- c(\"#706FD3\", \"#FF5252\")\nV(net)$cluster \u003c- twomoon$clusters\nE(net)$color \u003c- apply(as.data.frame(get.edgelist(net)), 1,\n                      function(x) ifelse(V(net)$cluster[x[1]] == V(net)$cluster[x[2]],\n                                        colors[V(net)$cluster[x[1]]], '#000000'))\nV(net)$color \u003c- colors[twomoon$clusters]\n# plot nodes\nplot(net, layout = twomoon$data, vertex.label = NA, vertex.size = 3)\n```\n\n## Contributing\nWe welcome all sorts of contributions. Please feel free to open an issue\nto report a bug or discuss a feature request.\n\n## Citation\nIf you made use of this software please consider citing:\n\n- J. V. de Miranda Cardoso, D. P. Palomar (2019). spectralGraphTopology: Learning Graphs from\n  Data via Spectral Constraints. \u003chttps://CRAN.R-project.org/package=spectralGraphTopology\u003e\n\n- S. Kumar, J. Ying, J. V. de Miranda Cardoso, and D. P. Palomar (2020). [A unified framework\n  for structured graph learning via spectral constraints](https://www.jmlr.org/papers/v21/19-276.html). Journal of Machine Learning Research (21), pages 1-60.\n\n- S. Kumar, J. Ying, J. V. de Miranda Cardoso, D. P. Palomar (2019). [Structured graph learning via Laplacian spectral constraints](https://papers.nips.cc/paper/9339-structured-graph-learning-via-laplacian-spectral-constraints.pdf). Advances in Neural Information Processing Systems.\n\nIn addition, consider citing the following bibliography according to their\nimplementation:\n\n| **function**                | **reference**                                                                                                                                                                                                                                                                                     |\n|-----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `cluster_k_component_graph` | N., Feiping, W., Xiaoqian, J., Michael I., and H., Heng. (2016). [The Constrained Laplacian Rank Algorithm for Graph-based Clustering](https://dl.acm.org/doi/10.5555/3016100.3016174), AAAI'16.                                                                                              |\n| `learn_laplacian_gle_mm`    | Licheng Zhao, Yiwei Wang, Sandeep Kumar, and Daniel P. Palomar, [Optimization Algorithms for Graph Laplacian Estimation via ADMM and MM](https://palomar.home.ece.ust.hk/papers/2019/ZhaoWangKumarPalomar-TSP2019.pdf), IEEE Trans. on Signal Processing, vol. 67, no. 16, pp. 4231-4244, Aug. 2019 |\n| `learn_laplacian_gle_admm`    | Licheng Zhao, Yiwei Wang, Sandeep Kumar, and Daniel P. Palomar, [Optimization Algorithms for Graph Laplacian Estimation via ADMM and MM](https://palomar.home.ece.ust.hk/papers/2019/ZhaoWangKumarPalomar-TSP2019.pdf), IEEE Trans. on Signal Processing, vol. 67, no. 16, pp. 4231-4244, Aug. 2019 |\n| `learn_combinatorial_graph_laplacian`    | H. E. Egilmez, E. Pavez and A. Ortega, [Graph learning from data under Laplacian and structural constraints](https://ieeexplore.ieee.org/document/7979524), Journal of Selected Topics in Signal Processing, vol. 11, no. 6, pp. 825-841, Sept. 2017 |\n\n## Links\nPackage: [CRAN](https://CRAN.R-project.org/package=spectralGraphTopology) and\n[GitHub](https://github.com/dppalomar/spectralGraphTopology)\n\nREADME file: [GitHub-readme](https://github.com/dppalomar/spectralGraphTopology/blob/master/README.md)\n\nVignette: [GitHub-html-vignette](https://raw.githack.com/dppalomar/spectralGraphTopology/master/vignettes/SpectralGraphTopology.html),\n[CRAN-html-vignette](https://cran.r-project.org/package=spectralGraphTopology/vignettes/SpectralGraphTopology.html),\n[NeurIPS'19 Promotional slides](https://docs.google.com/viewer?url=https://github.com/dppalomar/spectralGraphTopology/raw/master/vignettes/NeurIPS19-promo-slides.pdf),\n[NeurIPS'19 Promotional video](https://www.youtube.com/watch?v=klAqFvyQx7k)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconvexfi%2Fspectralgraphtopology","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconvexfi%2Fspectralgraphtopology","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconvexfi%2Fspectralgraphtopology/lists"}