{"id":18174455,"url":"https://github.com/dynverse/dynparam","last_synced_at":"2025-10-22T05:59:31.074Z","repository":{"id":56935361,"uuid":"158827226","full_name":"dynverse/dynparam","owner":"dynverse","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-04T15:54:07.000Z","size":567,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-22T05:59:27.141Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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}},"created_at":"2018-11-23T12:02:28.000Z","updated_at":"2025-10-06T09:26:05.000Z","dependencies_parsed_at":"2022-08-21T05:50:13.066Z","dependency_job_id":null,"html_url":"https://github.com/dynverse/dynparam","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dynverse/dynparam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynverse%2Fdynparam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynverse%2Fdynparam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynverse%2Fdynparam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynverse%2Fdynparam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dynverse","download_url":"https://codeload.github.com/dynverse/dynparam/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynverse%2Fdynparam/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280389300,"owners_count":26322507,"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-22T02:00:06.515Z","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":"2024-11-02T16:03:07.373Z","updated_at":"2025-10-22T05:59:31.059Z","avatar_url":"https://github.com/dynverse.png","language":"R","readme":"---\noutput: github_document\neditor_options: \n  chunk_output_type: console\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n# dynparam\n\nProvides tools for describing parameters of algorithms in an abstract way. \nDescription can include an id, a description, a domain (range or list of values), and a default value. \n'dynparam' can also convert parameter sets to a `ParamHelpers` format, in order to be able to use `dynparam` in conjunction with `mlrMBO`.\nCheck `?dynparam` for an overview of all functionality provided by dynparam.\n\n## Examples\nThe main goal of `dynparam` is to be able to describe a set of parameters, \nbe able to serialise the parameter sets, and also sample random settings from \nthe parameter set.\n\n```{r, message = FALSE, error = FALSE, warning = FALSE}\nlibrary(tidyverse)\nlibrary(dynparam)\nset.seed(1)\n```\n\n```{r, echo=FALSE}\ncat \u003c- function(x) {\n  base::cat(\n    \"```yaml\\n\",\n    x, \"\\n\", \n    \"```\",\n    sep = \"\"\n  )\n}\n```\n\nDefine a parameter set as follows:\n```{r}\nparameters \u003c- parameter_set(\n  integer_parameter(\n    id = \"num_iter\",\n    default = 100L,\n    distribution = expuniform_distribution(lower = 1L, upper = 10000L),\n    description = \"Number of iterations\"\n  ),\n  subset_parameter(\n    id = \"dimreds\",\n    default = c(\"pca\", \"mds\"),\n    values = c(\"pca\", \"mds\", \"tsne\", \"umap\", \"ica\"),\n    description = \"Which dimensionality reduction methods to apply (can be multiple)\"\n  ),\n  integer_range_parameter(\n    id = \"ks\",\n    default = c(3L, 15L),\n    lower_distribution = uniform_distribution(1L, 5L),\n    upper_distribution = uniform_distribution(10L, 20L),\n    description = \"The numbers of clusters to be evaluated\"\n  )\n)\n```\n\nYou can retrieve the default parameters as follows:\n```{r}\nget_defaults(parameters)\n```\n\nSerialise a parameter set from/to json/yaml with the `as.list()` and `as_parameter_set()` functions.\n```{r}\nli \u003c- as.list(parameters)\npa \u003c- as_parameter_set(li)\n```\n\nSample a parameter set using with `sip()`:\n```{r}\nsip(pa, n = 3)\n```\n\n### Large parameter set\n```{r}\nparameters \u003c- parameter_set(\n  integer_parameter(\n    id = \"num_iter\", \n    default = 100L,\n    distribution = expuniform_distribution(lower = 1L, upper = 10000L),\n    description = \"Number of iterations\"\n  ),\n  numeric_parameter(\n  id = \"delta\", \n  default = c(4.5, 2.4, 1.9), \n  distribution = normal_distribution(mean = 5, sd = 1),\n  description = \"Multiplying factors\"\n),\n  character_parameter(\n  id = \"method\", \n  default = \"kendall\",\n  values = c(\"kendall\", \"spearman\", \"pearson\"), \n  description = \"Correlation method\"\n),\n  logical_parameter(\n  id = \"inverse\",\n  default = TRUE, \n  description = \"Inversion parameter\"\n),\n  subset_parameter(\n id = \"dimreds\",\n default = c(\"pca\", \"mds\"),\n values = c(\"pca\", \"mds\", \"tsne\", \"umap\", \"ica\"),\n description = \"Which dimensionality reduction methods to apply (can be multiple)\"\n),\n  integer_range_parameter(\n  id = \"ks\",\n  default = c(3L, 15L),\n  lower_distribution = uniform_distribution(1L, 5L),\n  upper_distribution = uniform_distribution(10L, 20L),\n  description = \"The numbers of clusters to be evaluated.\"\n),\n  numeric_range_parameter(\n  id = \"quantiles\",\n  default = c(0.15, 0.90),\n  lower_distribution = uniform_distribution(0, .4),\n  upper_distribution = uniform_distribution(.6, 1),\n  description = \"Quantile cutoff range\"\n),\n  forbidden = \"inverse == (method == 'kendall')\"\n)\n```\n\nAs yaml:\n```{r comment = \"\", results = \"asis\"}\ncat(yaml::as.yaml(as.list(parameters)))\n```\n\nGenerate a random parameter set:\n```{r}\nsip(parameters, n = 2)\n```\n\nConvert paramhelper object:\n```{r}\nas_paramhelper(parameters)\n```\n\n\n## Latest changes\n\nCheck out `news(package = \"dynparam\")` or [NEWS.md](inst/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\"}\ndynutils::update_news()\nbase::cat(dynutils::recent_news())\n```\n\n## Dynverse dependencies\n\n\u003c!-- Generated by \"update_dependency_graphs.R\" in the main dynverse repo --\u003e\n![](man/figures/dependencies.png)\n","funding_links":[],"categories":["R"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdynverse%2Fdynparam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdynverse%2Fdynparam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdynverse%2Fdynparam/lists"}