{"id":14067421,"url":"https://github.com/tidymodels/shinymodels","last_synced_at":"2025-04-06T16:13:08.051Z","repository":{"id":40262904,"uuid":"373378921","full_name":"tidymodels/shinymodels","owner":"tidymodels","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-24T16:46:09.000Z","size":11611,"stargazers_count":48,"open_issues_count":3,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-30T15:08:16.482Z","etag":null,"topics":["r","r-package","rstats","shiny"],"latest_commit_sha":null,"homepage":"https://shinymodels.tidymodels.org/","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/tidymodels.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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}},"created_at":"2021-06-03T04:19:47.000Z","updated_at":"2025-01-25T02:05:57.000Z","dependencies_parsed_at":"2024-08-13T07:13:03.470Z","dependency_job_id":"10a9f690-c073-41da-ae61-fbfaf5590c0d","html_url":"https://github.com/tidymodels/shinymodels","commit_stats":{"total_commits":111,"total_committers":9,"mean_commits":"12.333333333333334","dds":0.6936936936936937,"last_synced_commit":"01c581e35f502d15a85fad4dd9a816437477a8a4"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidymodels%2Fshinymodels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidymodels%2Fshinymodels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidymodels%2Fshinymodels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidymodels%2Fshinymodels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tidymodels","download_url":"https://codeload.github.com/tidymodels/shinymodels/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509236,"owners_count":20950232,"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":["r","r-package","rstats","shiny"],"created_at":"2024-08-13T07:05:35.143Z","updated_at":"2025-04-06T16:13:08.022Z","avatar_url":"https://github.com/tidymodels.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\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# shinymodels\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)\n[![CRAN status](https://www.r-pkg.org/badges/version/shinymodels)](https://CRAN.R-project.org/package=shinymodels)\n[![Codecov test coverage](https://codecov.io/gh/tidymodels/shinymodels/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidymodels/shinymodels?branch=main)\n[![R-CMD-check](https://github.com/tidymodels/shinymodels/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidymodels/shinymodels/actions/workflows/R-CMD-check.yaml)\n[![R-CMD-check-no-suggests](https://github.com/tidymodels/shinymodels/actions/workflows/R-CMD-check-no-suggests.yaml/badge.svg)](https://github.com/tidymodels/shinymodels/actions/workflows/R-CMD-check-no-suggests.yaml)\n\u003c!-- badges: end --\u003e\n\nThe goal of shinymodels is to launch a Shiny app given tidymodels' tuning or resampling results, to make it easier to explore the modeling results.\n\n## Installation\n\nYou can install the released version of shinymodels from [CRAN](https://CRAN.R-project.org) with:\n\n``` r\ninstall.packages(\"shinymodels\") \n```\n\nAnd the development version from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"pak\")\npak::pak(\"tidymodels/shinymodels\")\n```\n\n## Example\n\nStart by tuning or fitting to resampling folds, using tune functions like `fit_resamples()` or `tune_bayes()`.\n\nAs an example, we will simulate a simple relationship:\n\n```{r load, include = FALSE}\nlibrary(shinymodels)\nlibrary(tidymodels)\ntidymodels_prefer()\n```\n\n```{r}\nlibrary(shinymodels)\nlibrary(tidymodels)\ntidymodels_prefer()\n\nset.seed(1)\nn \u003c- 100\nsimulated \u003c-\n  data.frame(x1 = runif(n, min = -1), x2 = runif(n)) %\u003e% \n  mutate(y = 3 - 5 * x1 + 15 * x1^2 +  + 10 * x2 + rnorm(n, sd = 5))\n```\n\nLet's resample a linear regression model that is missing an important nonlinear term (i.e., `poly(x1, 2)`):\n\n```{r}\nset.seed(2)\nfolds \u003c- vfold_cv(simulated)\n\nreg_res \u003c-\n  linear_reg() %\u003e%\n  fit_resamples(y ~ .,\n                resamples = folds,\n                control = control_resamples(save_pred = TRUE))\n```\n\nTo interactively assess the model fit, we can use the  `explore()` function: \n\n```r\nexplore(reg_res)\n```\n\nUse the Shiny app to explore the model results and detect any outliers or problematic observations. In the image below, the observed and predicted values are visualized, with one sample selected and highlighted. The residuals are also plotted against `x1` and the quadratic pattern shows that a nonlinear term should be added.  \n\n![screenshot of shiny app. Options are shown in a column to the left. In the main area 3 tabs are shown; Observed vs. Predicted, Residuals vs. Predicted, and Residals vs. A numeric predictor.](man/figures/example.png)\n\nThe `explore()` function can be used with objects produced by `fit_resamples()`, `last_fit()`, or any of the `tune_*()` functions. \n\n\n## Contributing\n\nThis project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\n\n- For questions and discussions about tidymodels packages, modeling, and machine learning, please [post on RStudio Community](https://community.rstudio.com/new-topic?category_id=15\u0026tags=tidymodels,question).\n\n- If you think you have encountered a bug, please [submit an issue](https://github.com/tidymodels/shinymodels/issues).\n\n- Either way, learn how to create and share a [reprex](https://reprex.tidyverse.org/articles/articles/learn-reprex.html) (a minimal, reproducible example), to clearly communicate about your code.\n\n- Check out further details on [contributing guidelines for tidymodels packages](https://www.tidymodels.org/contribute/) and [how to get help](https://www.tidymodels.org/help/).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidymodels%2Fshinymodels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftidymodels%2Fshinymodels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidymodels%2Fshinymodels/lists"}