{"id":50719024,"url":"https://github.com/engineerdanny/sparsefusion","last_synced_at":"2026-06-09T22:01:09.059Z","repository":{"id":338284441,"uuid":"1157337497","full_name":"EngineerDanny/sparsefusion","owner":"EngineerDanny","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-08T22:02:35.000Z","size":23756,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-08T23:09:05.397Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"BibTeX Style","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/EngineerDanny.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-13T17:48:59.000Z","updated_at":"2026-06-08T22:02:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/EngineerDanny/sparsefusion","commit_stats":null,"previous_names":["engineerdanny/fuserplus"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EngineerDanny/sparsefusion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineerDanny%2Fsparsefusion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineerDanny%2Fsparsefusion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineerDanny%2Fsparsefusion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineerDanny%2Fsparsefusion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EngineerDanny","download_url":"https://codeload.github.com/EngineerDanny/sparsefusion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineerDanny%2Fsparsefusion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34127345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"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":[],"created_at":"2026-06-09T22:01:07.634Z","updated_at":"2026-06-09T22:01:09.054Z","avatar_url":"https://github.com/EngineerDanny.png","language":"BibTeX Style","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sparsefusion\n\n`sparsefusion` fits grouped fused-regression models with L1 and L2 fusion\npenalties. The package extends the original grouped fused-regression workflow\nwith sparse graph solver variants that avoid building all-pair fusion objects\nwhen the fusion graph is sparse.\n\nThe paper focuses on one computational question:\n\n\u003e If the statistical penalty is defined on a sparse graph, can the solver keep\n\u003e that sparse edge representation instead of expanding to all group pairs?\n\n## Install\n\nFrom a checkout of this repository:\n\n```bash\nR CMD INSTALL .\n```\n\nOr from GitHub:\n\n```r\ninstall.packages(\"remotes\")\nremotes::install_github(\"EngineerDanny/sparsefusion\")\n```\n\nOptional packages used by the timing scripts:\n\n```r\ninstall.packages(c(\"atime\", \"ggplot2\"))\n```\n\n## Minimal Reviewer Example\n\nThis example creates a small grouped regression problem with a sparse chain\nfusion graph and fits one L1 active-edge model through the recommended\n`sparse_fusion()` interface.\n\n```r\nlibrary(sparsefusion)\n\nset.seed(1)\n\nk \u003c- 4L\np \u003c- 8L\nn_group \u003c- 8L\ngroups \u003c- rep(seq_len(k), each = n_group)\n\nX \u003c- matrix(rnorm(length(groups) * p), nrow = length(groups), ncol = p)\n\nbeta \u003c- matrix(0, nrow = p, ncol = k)\nbeta[1:2, 1:2] \u003c- 1\nbeta[1:2, 3:4] \u003c- -1\n\ny \u003c- rowSums(X * t(beta[, groups, drop = FALSE])) +\n  rnorm(length(groups), sd = 0.1)\n\nG \u003c- matrix(0, k, k)\nfor (i in seq_len(k - 1L)) {\n  G[i, i + 1L] \u003c- 1\n  G[i + 1L, i] \u003c- 1\n}\n\nfit \u003c- sparse_fusion(\n  X, y, groups,\n  lambda = 1e-3, gamma = 1e-2, G = G,\n  fusion = \"l1\", solver = \"active_edge\",\n  mu = 1e-4, tol = 1e-3, num.it = 800,\n  intercept = FALSE, scaling = FALSE\n)\n\ndim(fit)\n```\n\nExpected dimensions are `p` by `k`, here `8` by `4`.\n\n## Conceptual Timing Panels\n\nThe conceptual figures in the paper use timing panels that compare full-pairwise\nreference construction with active-edge construction.\nRun the L1 timing panel from the repository root:\n\n```bash\nRscript scripts/benchmark_atime_l1_variants.R \\\n  --data_mode synthetic \\\n  --k_values 10,20,30,40,50,80,100 \\\n  --p 120 \\\n  --n_group_train 35 \\\n  --g_structure sparse_chain \\\n  --times 3 \\\n  --out_prefix atime_l1_variants\n```\n\nThis writes:\n\n```text\nbuild/atime_l1_variants_summary.csv\nbuild/atime_l1_variants_atime_obj.rds\ninst/figures/atime_l1_variants_atime.png\n```\n\nRun the L2 timing panel:\n\n```bash\nRscript scripts/benchmark_atime_l2_variants.R \\\n  --data_mode synthetic \\\n  --k_values 10,20,30,40,50,80,100 \\\n  --p 120 \\\n  --n_group_train 35 \\\n  --g_structure sparse_chain \\\n  --times 3 \\\n  --out_prefix atime_l2\n```\n\nThis writes:\n\n```text\nbuild/atime_l2_l2_summary.csv\nbuild/atime_l2_l2_atime_obj.rds\ninst/figures/atime_l2_l2_atime.png\n```\n\n\n## Tests\n\nRun the package tests from the repository root:\n\n```bash\nR -q -e \"testthat::test_dir('tests/testthat')\"\n```\n\n## Notes On Solver Variants\n\nUse `fusion = \"l1\"` for smoothed L1 fusion and `fusion = \"l2\"` for the\naugmented-design L2 solver. Available solver values are:\n\n- `active_edge`, the sparse-graph solver used as the recommended default.\n- `full_pairwise`, the all-pair reference construction.\n- `chain_approx`, the approximate L1 chain solver.\n\nFor a longer modeling walkthrough, see `vignettes/subgroup_fusion.Rmd`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineerdanny%2Fsparsefusion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fengineerdanny%2Fsparsefusion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineerdanny%2Fsparsefusion/lists"}