{"id":18444893,"url":"https://github.com/spsanderson/tidyaml","last_synced_at":"2025-10-24T03:55:03.795Z","repository":{"id":64457177,"uuid":"573189339","full_name":"spsanderson/tidyAML","owner":"spsanderson","description":"Auto ML for the tidyverse","archived":false,"fork":false,"pushed_at":"2024-05-04T01:11:36.000Z","size":7697,"stargazers_count":64,"open_issues_count":0,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-06T20:35:21.515Z","etag":null,"topics":["automatic-machine-learning","automl","classification","machine-learning","parsnip","r","r-language","r-package","r-programming","r-stats","regression","tidy","tidymodels","tidyverse"],"latest_commit_sha":null,"homepage":"http://www.spsanderson.com/tidyAML/","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/spsanderson.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"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":"2022-12-01T22:23:39.000Z","updated_at":"2024-09-07T16:49:54.000Z","dependencies_parsed_at":"2023-11-29T04:22:47.737Z","dependency_job_id":"d67764a3-9a8c-4465-be47-cf69697fd430","html_url":"https://github.com/spsanderson/tidyAML","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spsanderson%2FtidyAML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spsanderson%2FtidyAML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spsanderson%2FtidyAML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spsanderson%2FtidyAML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spsanderson","download_url":"https://codeload.github.com/spsanderson/tidyAML/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223297239,"owners_count":17121977,"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":["automatic-machine-learning","automl","classification","machine-learning","parsnip","r","r-language","r-package","r-programming","r-stats","regression","tidy","tidymodels","tidyverse"],"created_at":"2024-11-06T07:04:09.040Z","updated_at":"2025-10-24T03:55:03.790Z","avatar_url":"https://github.com/spsanderson.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# tidyAML \u003cimg src=\"man/figures/logo.png\" width=\"147\" height=\"170\" align=\"right\" /\u003e\n\n\u003c!-- badges: start --\u003e\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/tidyAML)](https://cran.r-project.org/package=tidyAML)\n![](https://cranlogs.r-pkg.org/badges/tidyAML)\n![](https://cranlogs.r-pkg.org/badges/grand-total/tidyAML)\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html##experimental)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://kentcdodds.github.io/makeapullrequest.com/)\n\u003c!-- badges: end --\u003e\n\n## Introduction\n\nWelcome to __`{tidyAML}`__ which is a new R package that makes it easy to use the `tidymodels` ecosystem to perform automated machine learning (AutoML). This package provides a simple and intuitive interface that allows users to quickly generate machine learning models without worrying about the underlying details. It also includes a safety mechanism that ensures that the package will fail gracefully if any required extension packages are not installed on the user's machine. With `{tidyAML}`, users can easily build high-quality machine learning models in just a few lines of code. Whether you are a beginner or an experienced machine learning practitioner, `{tidyAML}` has something to offer.\n\nSome ideas are that we should be able to generate regression\nmodels on the fly without having to actually go through the process of building the\nspecification, especially if it is a non-tuning model, meaning we are not planing\non tuning hyper-parameters like `penalty` and `cost`.\n\nThe idea is not to re-write the excellent work the `tidymodels` team has done (because\nit's not possible) but rather to try and make an enhanced easy to use set of functions\nthat do what they say and can generate many models and predictions at once.\n\nThis is similar to the great `h2o` package, but, `{tidyAML}` does not require java\nto be setup properly like `h2o` because `{tidyAML}` is built on `tidymodels`.\n\n## Thanks\n\nThank you [Garrick Aden-Buie](https://fosstodon.org/@grrrck/109479826278916014) for the easy name change suggestion.\n\n## Installation\n\nYou can install `{tidyAML}` like so:\n\n```{r message=FALSE, warning=FALSE}\n#install.packages(\"tidyAML\")\n```\nOr the development version from GitHub\n```{r, warning=FALSE, message=FALSE}\n# install.packages(\"devtools\")\n#devtools::install_github(\"spsanderson/tidyAML\")\n```\n\n## Examples\n\nPart of the reason to use `{tidyAML}` is so that you can generate many models of\nyour data set. One way of modeling a data set is using regression for some numeric\noutput. There is a convienent function in __tidyAML__ that will generate a set of\nnon-tuning models for _fast regression_. Let's take a look below.\n\nFirst let's load the library\n\n```{r example}\nlibrary(tidyAML)\n```\n\nNow lets see the function in action.\n\n```{r message=FALSE, warning=FALSE}\nfast_regression_parsnip_spec_tbl(.parsnip_fns = \"linear_reg\")\nfast_regression_parsnip_spec_tbl(.parsnip_eng = c(\"lm\",\"glm\"))\nfast_regression_parsnip_spec_tbl(.parsnip_eng = c(\"lm\",\"glm\",\"gee\"), \n                                 .parsnip_fns = \"linear_reg\")\n```\n\nAs shown we can easily select the models we want either by choosing the supported\n`parsnip` function like `linear_reg()` or by choose the desired `engine`, you can \nalso use them both in conjunction with each other!\n\nThis function also does add a class to the output. Let's see it.\n\n```{r message=FALSE, warning=FALSE}\nclass(fast_regression_parsnip_spec_tbl())\n```\n\nWe see that there are two added classes, first `fst_reg_spec_tbl` because this \ncreates a set of non-tuning regression models and then `tidyaml_mod_spec_tbl` because\nthis is a model specification tibble built with `{tidyAML}`\n\nNow, what if you want to create a non-tuning model spec without using the \n`fast_regression_parsnip_spec_tbl()` function. Well, you can. The function is called\n`create_model_spec()`. \n\n```{r message=FALSE, warning=FALSE}\ncreate_model_spec(\n .parsnip_eng = list(\"lm\",\"glm\",\"glmnet\",\"cubist\"),\n .parsnip_fns = list(\n      \"linear_reg\",\n      \"linear_reg\",\n      \"linear_reg\",\n      \"cubist_rules\"\n     )\n )\n\ncreate_model_spec(\n .parsnip_eng = list(\"lm\",\"glm\",\"glmnet\",\"cubist\"),\n .parsnip_fns = list(\n      \"linear_reg\",\n      \"linear_reg\",\n      \"linear_reg\",\n      \"cubist_rules\"\n     ),\n .return_tibble = FALSE\n )\n```\n\nNow the reason we are here. Let's take a look at the first function for modeling \nwith `{tidyAML}`, __`fast_regression()`__.\n\n```{r, warning=FALSE, message=FALSE}\nlibrary(recipes)\nlibrary(dplyr)\n\nrec_obj \u003c- recipe(mpg ~ ., data = mtcars)\nfrt_tbl \u003c- fast_regression(\n  .data = mtcars, \n  .rec_obj = rec_obj, \n  .parsnip_eng = c(\"lm\",\"glm\",\"gee\"),\n  .parsnip_fns = \"linear_reg\",\n  .drop_na = FALSE\n)\n\nglimpse(frt_tbl)\n```\n\nAs we see above, one of the models has gracefully failed, thanks in part to the \nfunction `purrr::safely()`, which was used to make what I call __safe_make__ functions.\n\nLet's look at the fitted workflow predictions.\n\n```{r message=FALSE, warning=FALSE}\nfrt_tbl$pred_wflw\n```\n\nNow let's load the `multilevelmod` library so that we can run the `gee` linear regression.\n\n```{r message=FALSE, warning=FALSE}\nlibrary(multilevelmod)\n\nrec_obj \u003c- recipe(mpg ~ ., data = mtcars)\nfrt_tbl \u003c- fast_regression(\n  .data = mtcars, \n  .rec_obj = rec_obj, \n  .parsnip_eng = c(\"lm\",\"glm\",\"gee\"),\n  .parsnip_fns = \"linear_reg\"\n)\n\nextract_wflw_pred(frt_tbl, 1:3)\n```\n\n_Getting Regression Residuals_\n\nGetting residuals is easy with `{tidyAML}`. Let's take a look.\n\n```{r message=FALSE, warning=FALSE}\nextract_regression_residuals(frt_tbl)\n```\n\nYou can also pivot them into a long format making plotting easy with `ggplot2`.\n\n```{r message=FALSE, warning=FALSE}\nextract_regression_residuals(frt_tbl, .pivot_long = TRUE)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspsanderson%2Ftidyaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspsanderson%2Ftidyaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspsanderson%2Ftidyaml/lists"}