{"id":20114431,"url":"https://github.com/kisungyou/rdimtools","last_synced_at":"2025-05-06T12:31:07.671Z","repository":{"id":52233443,"uuid":"112887447","full_name":"kisungyou/Rdimtools","owner":"kisungyou","description":"Dimension Reduction and Estimation Methods","archived":false,"fork":false,"pushed_at":"2022-12-15T17:44:58.000Z","size":94757,"stargazers_count":52,"open_issues_count":3,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T12:22:26.163Z","etag":null,"topics":["dimension-estimation","dimension-reduction","manifold-learning","r","subspace-learning"],"latest_commit_sha":null,"homepage":"https://kisungyou.com/Rdimtools","language":"R","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/kisungyou.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":"2017-12-03T00:10:16.000Z","updated_at":"2024-09-19T05:22:47.000Z","dependencies_parsed_at":"2023-01-29T04:01:00.960Z","dependency_job_id":null,"html_url":"https://github.com/kisungyou/Rdimtools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kisungyou%2FRdimtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kisungyou%2FRdimtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kisungyou%2FRdimtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kisungyou%2FRdimtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kisungyou","download_url":"https://codeload.github.com/kisungyou/Rdimtools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252683455,"owners_count":21788044,"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":["dimension-estimation","dimension-reduction","manifold-learning","r","subspace-learning"],"created_at":"2024-11-13T18:29:44.307Z","updated_at":"2025-05-06T12:31:06.532Z","avatar_url":"https://github.com/kisungyou.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 setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  fig.align = \"center\",\n  out.width = \"100%\"\n)\n```\n\n\n\n# Rdimtools \u003ca href='https://www.kisungyou.com/Rdimtools/'\u003e\u003cimg src='man/figures/logo.png' align=\"right\" height=\"139\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/Rdimtools?color=green)](https://cran.r-project.org/package=Rdimtools)\n[![Travis-CI Build Status](https://travis-ci.org/kisungyou/Rdimtools.svg?branch=master)](https://travis-ci.org/kisungyou/Rdimtools)\n[![](https://cranlogs.r-pkg.org/badges/Rdimtools)](https://cran.r-project.org/package=Rdimtools)\n\u003c!-- badges: end --\u003e\n\n```{r echo=FALSE, include=FALSE}\nlibrary(Rdimtools)\nndo  = (sum(unlist(lapply(ls(\"package:Rdimtools\"), startsWith, \"do.\"))))\nnest = (sum(unlist(lapply(ls(\"package:Rdimtools\"), startsWith, \"est.\"))))\n```\n\n\n**Rdimtools** is an R package for dimension reduction (DR) - including feature selection and manifold learning - and intrinsic dimension estimation (IDE) methods. We aim at building one of the *most comprehensive* toolbox available online, where current version delivers `r ndo` DR algorithms and `r nest` IDE methods. \n\nThe philosophy is simple, **the more we have at hands, the better we can play**.\n\n\n## Elephant\n\nOur logo characterizes the foundational nature of multivariate data analysis; we may be blind people wrangling the data to see an [elephant](https://en.wikipedia.org/wiki/Blind_men_and_an_elephant) to grasp an idea of what the data looks like with partial information from each algorithm.\n\n\n## Installation\n\nYou can install a release version from CRAN:\n```r\ninstall.packages(\"Rdimtools\")\n```\n\nor the development version from github:\n```r\n## install.packages(\"devtools\")\ndevtools::install_github(\"kisungyou/Rdimtools\")\n```\n\n## Minimal Example : Dimension Reduction\n\nHere is an example of dimension reduction on the famous `iris` dataset. Principal Component Analysis (`do.pca`), Laplacian Score (`do.lscore`), and Diffusion Maps (`do.dm`) are compared, each from a family of algorithms for linear reduction, feature extraction, and nonlinear reduction.\n\n```{r message=FALSE, warning=FALSE, fig.align='center', fig.width=7}\n# load the library\nlibrary(Rdimtools)\n\n# load the data\nX   = as.matrix(iris[,1:4])\nlab = as.factor(iris[,5])\n\n# run 3 algorithms mentioned above\nmypca = do.pca(X, ndim=2)\nmylap = do.lscore(X, ndim=2)\nmydfm = do.dm(X, ndim=2, bandwidth=10)\n\n# visualize\npar(mfrow=c(1,3))\nplot(mypca$Y, pch=19, col=lab, xlab=\"axis 1\", ylab=\"axis 2\", main=\"PCA\")\nplot(mylap$Y, pch=19, col=lab, xlab=\"axis 1\", ylab=\"axis 2\", main=\"Laplacian Score\")\nplot(mydfm$Y, pch=19, col=lab, xlab=\"axis 1\", ylab=\"axis 2\", main=\"Diffusion Maps\")\n```\n\n\n## Minimal Example : Dimension Estimation\n\n![](https://people.cs.uchicago.edu/~dinoj/manifold/swissroll.gif)\n\nSwill Roll is a classic example of 2-dimensional manifold embedded in $\\mathbb{R}^3$ and one of 11 famous model-based samples from `aux.gensamples()` function. Given the ground truth that $d=2$, let's apply several methods for intrinsic dimension estimation.\n\n```{r message=FALSE, warning=FALSE, fig.align='center', fig.width=7, fig.height=3}\n# generate sample data\nset.seed(100)\nroll = aux.gensamples(dname=\"swiss\")\n\n# we will compare 6 methods (out of 17 methods from version 1.0.0)\nvecd = rep(0,5)\nvecd[1] = est.Ustat(roll)$estdim       # convergence rate of U-statistic on manifold\nvecd[2] = est.correlation(roll)$estdim # correlation dimension\nvecd[3] = est.made(roll)$estdim        # manifold-adaptive dimension estimation\nvecd[4] = est.mle1(roll)$estdim        # MLE with Poisson process\nvecd[5] = est.twonn(roll)$estdim       # minimal neighborhood information\n\n# let's visualize\nplot(1:5, vecd, type=\"b\", ylim=c(1.5,2.5), \n     main=\"true dimension is d=2\",\n     xaxt=\"n\",xlab=\"\",ylab=\"estimated dimension\")\nxtick = seq(1,5,by=1)\naxis(side=1, at=xtick, labels = FALSE)\ntext(x=xtick,  par(\"usr\")[3], \n     labels = c(\"Ustat\",\"correlation\",\"made\",\"mle1\",\"twonn\"), pos=1, xpd = TRUE)\n```\n\nWe can observe that all 5 methods we tested estimated the intrinsic dimension around $d=2$. It should be noted that the estimated dimension may not be integer-valued due to characteristics of each method.\n\n\n## Acknowledgements\n\nThe logo icon is made by [Freepik](https://www.flaticon.com/authors/freepik/) from [www.flaticon.com](https://www.flaticon.com/).The rotating Swiss Roll image is taken from [Dinoj Surendran](https://people.cs.uchicago.edu/~dinoj/manifold/swissroll.html)'s website.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkisungyou%2Frdimtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkisungyou%2Frdimtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkisungyou%2Frdimtools/lists"}