{"id":32177585,"url":"https://github.com/dynverse/lmds","last_synced_at":"2026-02-20T16:01:42.983Z","repository":{"id":56936720,"uuid":"207072659","full_name":"dynverse/lmds","owner":"dynverse","description":"Landmark Multi-Dimensional Scaling","archived":false,"fork":false,"pushed_at":"2023-09-22T12:03:04.000Z","size":1870,"stargazers_count":8,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-09T21:24:00.712Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://dynverse.org/lmds/","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/dynverse.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,"governance":null}},"created_at":"2019-09-08T06:40:25.000Z","updated_at":"2024-09-21T04:55:05.000Z","dependencies_parsed_at":"2022-08-21T07:20:45.732Z","dependency_job_id":"4a36c672-f27f-49bb-ae59-c2f533f95d07","html_url":"https://github.com/dynverse/lmds","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"9b66a2c82499baadb76ec2f0d08f03fc8886bbf4"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dynverse/lmds","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynverse%2Flmds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynverse%2Flmds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynverse%2Flmds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynverse%2Flmds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dynverse","download_url":"https://codeload.github.com/dynverse/lmds/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynverse%2Flmds/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29656589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T09:27:29.698Z","status":"ssl_error","status_checked_at":"2026-02-20T09:26:12.373Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-21T20:13:44.197Z","updated_at":"2026-02-20T16:01:42.977Z","avatar_url":"https://github.com/dynverse.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: \"lmds\"\noutput: github_document\n---\n\n  \u003c!-- badges: start --\u003e\n  [![R-CMD-check](https://github.com/dynverse/lmds/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/dynverse/lmds/actions/workflows/R-CMD-check.yaml)\n  \u003c!-- badges: end --\u003e\n\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  out.width = \"100%\",\n  fig.path = \"man/figures/\",\n  message = FALSE,\n  dpi = 300\n)\nset.seed(1)\nlibrary(tidyverse)\n```\n\n# `lmds`:  Landmark Multi-Dimensional Scaling\n\nA fast dimensionality reduction method scaleable to large numbers of samples.\nLandmark Multi-Dimensional Scaling (LMDS) is an extension of classical Torgerson MDS,\nbut rather than calculating a complete distance matrix between all pairs of samples,\nonly the distances between a set of landmarks and the samples are calculated.\n\n```{r compare}\nlibrary(lmds)\nx \u003c- as.matrix(iris[,1:4])\ndimred \u003c- lmds(x, ndim = 2)\nqplot(dimred[,1], dimred[,2]) + labs(title = \"lmds()\") + theme_classic()\n\ndimred \u003c- cmdscale(dist(x))\nqplot(dimred[,1], dimred[,2]) + labs(title = \"cmdscale()\") + theme_classic()\n```\n\n\n## Execution time\nThe execution time of `lmds()` scales linearly with respect to the dataset size.\n```{r timings, echo=FALSE}\nlargex \u003c- Matrix::rsparsematrix(nrow = 100000, ncol = 10000, density = .01)\n\nlog \u003c- list()\nnum_samples \u003c- 100\ntime \u003c- 0\nwhile (time \u003c 10) {\n  subx \u003c- largex[seq_len(num_samples),]\n  time \u003c- system.time({\n    dimred \u003c- lmds(subx)\n  })[[\"user.self\"]]\n  log[[length(log) + 1]] \u003c- tibble(method = \"lmds()\", num_samples, time)\n  num_samples \u003c- num_samples * 1.5\n}\n\nnum_samples \u003c- 100\ntime \u003c- 0\nwhile (time \u003c 10) {\n  subx \u003c- largex[seq_len(num_samples),]\n  time \u003c- system.time({\n    dist \u003c- dist(subx)\n    dimred \u003c- cmdscale(dist)\n  })[[\"user.self\"]]\n  log[[length(log) + 1]] \u003c- tibble(method = \"cmdscale()\", num_samples, time)\n  num_samples \u003c- num_samples * 1.5\n}\n\nlogdf \u003c- bind_rows(log)\n\nggplot(logdf, aes(num_samples, time, colour = method)) + \n  geom_point() +\n  geom_line() +\n  theme_classic()\n```\n\n## Latest changes\n\nCheck out `news(package = \"lmds\")` or [NEWS.md](NEWS.md) for a full list of changes.\n\n\u003c!-- This section gets automatically generated from inst/NEWS.md, and also generates inst/NEWS --\u003e\n\n```{r news, echo=FALSE, results=\"asis\"}\ncat(dynutils::recent_news())\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdynverse%2Flmds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdynverse%2Flmds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdynverse%2Flmds/lists"}