{"id":31936221,"url":"https://github.com/bbuchsbaum/dkge","last_synced_at":"2025-10-14T07:25:19.259Z","repository":{"id":315815943,"uuid":"1060921699","full_name":"bbuchsbaum/dkge","owner":"bbuchsbaum","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-20T22:58:38.000Z","size":176,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-20T23:34:26.152Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://bbuchsbaum.github.io/dkge/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbuchsbaum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-09-20T21:40:00.000Z","updated_at":"2025-09-20T22:58:42.000Z","dependencies_parsed_at":"2025-09-20T23:34:34.360Z","dependency_job_id":"68c8b166-5f5b-41dc-b0ec-238d62cc523f","html_url":"https://github.com/bbuchsbaum/dkge","commit_stats":null,"previous_names":["bbuchsbaum/dkge"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/bbuchsbaum/dkge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Fdkge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Fdkge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Fdkge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Fdkge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbuchsbaum","download_url":"https://codeload.github.com/bbuchsbaum/dkge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Fdkge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018215,"owners_count":26086303,"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-10-14T02:00:06.444Z","response_time":60,"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":"2025-10-14T07:25:18.033Z","updated_at":"2025-10-14T07:25:19.251Z","avatar_url":"https://github.com/bbuchsbaum.png","language":"R","readme":"# dkge\n\nDesign-Kernel Group Embedding (DKGE) turns subject-level GLM outputs into a shared, design-aware latent space. It preserves the structure of experimental designs, supports cross-validated contrasts, and provides transport utilities for mapping parcellated fields onto common anchor or voxel representations.\n\n## Key capabilities\n- **Flexible design kernels** – encode factorial structure, smoothness, and interactions to control how effects align across subjects.\n- **Robust contrasts and inference** – LOSO/K-fold cross-fitting, analytic approximations, and bootstrap utilities for medoid or voxel maps.\n- **Transport \u0026 rendering** – barycentric kNN and C++-accelerated Sinkhorn mappers with warm starts, anchor graph smoothing, and voxel decoders.\n- **Classifier localisation** – cross-fitted latent classifiers with decoder, Haufe, and LOCO maps for bias-aware whole-brain interpretation.\n- **Component interpretability** – convenience helpers for projecting new data, rotating components, and summarising variance explained.\n\n## Installation\n```r\n# install.packages(\"remotes\")\nremotes::install_github(\"bbuchsbaum/dkge\")\n```\nThe package depends on `RcppArmadillo`, `future`, `multivarious`, and other CRAN libraries; these install automatically.\n\n## Getting started\n```r\nlibrary(dkge)\n\n# simulate three subjects with four effects and five clusters\nset.seed(1)\nbetas \u003c- replicate(3, matrix(rnorm(4 * 5), 4, 5), simplify = FALSE)\ndesigns \u003c- replicate(3, qr.Q(qr(matrix(rnorm(60 * 4), 60, 4))), simplify = FALSE)\n\n# fit DKGE with an identity kernel and rank 2\nfit \u003c- dkge(betas, designs, kernel = diag(4), rank = 2)\n\n# project subjects into component space\nscores \u003c- dkge_project_btil(fit, fit$Btil)\nstr(scores, max.level = 1)\n```\nSee the vignettes for full workflows:\n\n- `vignette(\"dkge-workflow\")`\n- `vignette(\"dkge-design-kernels\")`\n- `vignette(\"dkge-contrasts-inference\")`\n- `vignette(\"dkge-dense-rendering\")`\n- `vignette(\"dkge-components\")`\n- `vignette(\"dkge-performance\")`\n- `vignette(\"dkge-weighting\")`\n\n## Helper constructors\n\nDKGE now provides small helper constructors that validate common orchestration inputs.\nThey shorten calls to `dkge_pipeline()` and prediction helpers while keeping backward\ncompatibility with raw lists.\n\n```r\nkernel \u003c- diag(nrow(betas[[1]]))\ntransport \u003c- dkge_transport_spec(\n  centroids = centroids,\n  sizes = sizes,\n  medoid = 2\n)\ninference \u003c- dkge_inference_spec(B = 1000, tail = \"two.sided\")\ncls_spec \u003c- dkge_classification_spec(targets = ~ condition, method = \"lda\")\n\nresults \u003c- dkge_pipeline(\n  betas = betas,\n  designs = designs,\n  kernel = kernel,\n  contrasts = contrasts,\n  transport = transport,\n  inference = inference,\n  classification = cls_spec\n)\n```\n\nTo score new subjects without manually assembling `B_list`, use\n`dkge_predict_subjects()`:\n\n```r\npred \u003c- dkge_predict_subjects(fit, betas = new_subjects, contrasts = my_contrasts)\n```\n\n\n## Documentation \u0026 support\nRendered articles and function reference are available at the pkgdown site: \u003chttps://bbuchsbaum.github.io/dkge/\u003e. Issues and feature requests are welcome on the [GitHub tracker](https://github.com/bbuchsbaum/dkge/issues).\n\n## Development\n- Pull requests are encouraged; please accompany user-facing changes with tests and documentation.\n- For large feature work, open an issue to discuss design choices before implementation.\n\n## License\nMIT License. See `LICENSE` for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbuchsbaum%2Fdkge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbuchsbaum%2Fdkge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbuchsbaum%2Fdkge/lists"}