{"id":16573274,"url":"https://github.com/jefferis/manifoldreduction","last_synced_at":"2026-06-10T14:30:58.748Z","repository":{"id":34405124,"uuid":"38333788","full_name":"jefferis/manifoldreduction","owner":"jefferis","description":"Manifold Dimension Reduction after Chigirev and Bialek","archived":false,"fork":false,"pushed_at":"2019-10-23T08:16:30.000Z","size":612,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-05T15:12:25.214Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://jefferis.github.io/manifoldreduction/","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/jefferis.png","metadata":{"files":{"readme":"README.Rmd","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}},"created_at":"2015-06-30T21:22:23.000Z","updated_at":"2020-02-26T01:45:40.000Z","dependencies_parsed_at":"2022-08-03T20:45:17.913Z","dependency_job_id":null,"html_url":"https://github.com/jefferis/manifoldreduction","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jefferis/manifoldreduction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jefferis%2Fmanifoldreduction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jefferis%2Fmanifoldreduction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jefferis%2Fmanifoldreduction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jefferis%2Fmanifoldreduction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jefferis","download_url":"https://codeload.github.com/jefferis/manifoldreduction/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jefferis%2Fmanifoldreduction/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34157453,"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-10T02:00:07.152Z","response_time":89,"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":"2024-10-11T21:29:52.083Z","updated_at":"2026-06-10T14:30:58.728Z","avatar_url":"https://github.com/jefferis.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# manifoldreduction\n\n\u003c!-- badges: start --\u003e\n[![Travis build status](https://travis-ci.org/jefferis/manifoldreduction.svg?branch=master)](https://travis-ci.org/jefferis/manifoldreduction)\n[![Docs](https://img.shields.io/badge/docs-100%25-brightgreen.svg)](https://jefferis.github.io/manifoldreduction/reference/)\n\u003c!-- badges: end --\u003e\n\nAn implementation of Chigirev and Bialek's algorithm described in \"Optimal Manifold Representation of Data: An Information Theoretic Approach\".\n\n## Quick Start\n\nFor the impatient ...\n\n```{r, eval=FALSE}\n# install\nif (!require(\"devtools\")) install.packages(\"devtools\")\ndevtools::install_github(\"jefferis/manifoldreduction\")\n\n# use\nlibrary(manifoldreduction)\n\n# help for functions\n?manifold_reduction\n\n# run tests\nlibrary(testthat)\ntest_package(\"manifoldreduction\")\n```\n\n## Installation\nCurrently there isn't a released version on [CRAN](http://cran.r-project.org/) but you can use the **remotes** package to install the development version:\n\n```{r, eval=FALSE}\nif (!require(\"remotes\")) install.packages(\"remotes\")\ndevtools::install_github(\"jefferis/manifoldreduction\")\n```\n\nNote: Windows users may need [Rtools](http://www.murdoch-sutherland.com/Rtools/) and [remotes](http://CRAN.R-project.org/package=devtools) to install this way.\n\n## Example\n\nAs an example, let's use a noisy 2D circle. First a helper function for\nthe parametric form of the equation of a circle: \n\n```{r}\ncircle \u003c- function(r = 1, x = 0, y = 0, n = 360) {\n  theta = seq(from = 0,\n              to = 2 * pi,\n              length.out = n)\n  cbind(X = x + r * cos(theta), Y = y + r * sin(theta))\n}\n```\n\nNow we can add a bit of noise to the radius\n```{r}\nnoisy_circle=circle(r=rnorm(360, mean=1, sd=.1))\nplot(noisy_circle, asp = 1)\nlines(circle(), col='black')\n```\n\nNow let's try recovering a low dimensional manifold. The default parameters\nwill essentially look for a line.\n\n```{r}\nlibrary(manifoldreduction)\n# NB expects d x N points (not N x d)\nq=manifold_reduction(t(noisy_circle), no_iterations = 10, Verbose=FALSE)\n```\n\nThis toy example converges fast, so I have reduced the number of iterations.\nIf you plot the results (red line), you can see that it does a good job of smoothly recovering the structure of the original input points.\n\n```{r}\nplot(noisy_circle, asp=1)\nlines(circle(), col='black')\nlines(t(q$gamma), col='red')\n```\n\nHowever there is a clear bias in the position of the recovered circle. This\nis down to the structure in these data - distant points in the dataset still contribute to the reconstruction of the manifold which will therefore be biased towards a medial position. If one reduces the number of points\nthat are used:\n\n```{r}\nq2=manifold_reduction(t(noisy_circle), no_iterations = 10, Verbose=FALSE, knntouse = 40)\nplot(noisy_circle, asp=1)\nlines(circle(), col='black')\nlines(t(q$gamma), col='red')\nlines(t(q2$gamma), col='blue')\n```\n\nthen one obtains a less biased but somewhat noisier estimate (blue) (compare with the previous estimate in red or the underlying circle in black).\n\nOf course this toy example could be better solved if one used a knowledge \nof the expected distribution (a circle) as part of the fitting process. \nHowever the interesting point with this method is that it is a rather \ngeneral procedure that can be used for arbitrary point distributions\nin higher dimensions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjefferis%2Fmanifoldreduction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjefferis%2Fmanifoldreduction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjefferis%2Fmanifoldreduction/lists"}