{"id":13400742,"url":"https://github.com/tidymodels/modeldb","last_synced_at":"2025-05-08T19:46:35.676Z","repository":{"id":53306883,"uuid":"123516672","full_name":"tidymodels/modeldb","owner":"tidymodels","description":"Run models inside a database using R","archived":false,"fork":false,"pushed_at":"2024-01-04T23:25:39.000Z","size":6425,"stargazers_count":79,"open_issues_count":5,"forks_count":10,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-10-31T22:03:14.741Z","etag":null,"topics":["database","dbplyr","dplyr","ggplot2","modeling","rlang","sql","tidyeval","visualization"],"latest_commit_sha":null,"homepage":"https://modeldb.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":null,"contributing":null,"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}},"created_at":"2018-03-02T02:01:56.000Z","updated_at":"2024-10-15T13:19:08.000Z","dependencies_parsed_at":"2024-01-05T00:56:53.556Z","dependency_job_id":"6c2965f4-4b4a-4833-a349-4eaeaa1199c5","html_url":"https://github.com/tidymodels/modeldb","commit_stats":{"total_commits":123,"total_committers":9,"mean_commits":"13.666666666666666","dds":"0.44715447154471544","last_synced_commit":"2cb0cd3d692172c999cfa0d88d7a54e7e53c2d9b"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidymodels%2Fmodeldb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidymodels%2Fmodeldb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidymodels%2Fmodeldb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidymodels%2Fmodeldb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tidymodels","download_url":"https://codeload.github.com/tidymodels/modeldb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225110575,"owners_count":17422411,"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":["database","dbplyr","dplyr","ggplot2","modeling","rlang","sql","tidyeval","visualization"],"created_at":"2024-07-30T19:00:55.077Z","updated_at":"2024-11-18T01:04:54.616Z","avatar_url":"https://github.com/tidymodels.png","language":"R","readme":"---\noutput: github_document\n---\n\n# modeldb \u003cimg src=\"man/figures/logo.png\" align=\"right\" alt=\"\" width=\"120\" /\u003e\n\n```{r setup, include=FALSE}\nlibrary(dplyr)\nlibrary(modeldb)\n```\n\n[![R-CMD-check](https://github.com/tidymodels/modeldb/workflows/R-CMD-check/badge.svg)](https://github.com/tidymodels/modeldb/actions)\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/modeldb)](https://CRAN.R-project.org/package=modeldb)\n[![Codecov test coverage](https://codecov.io/gh/tidymodels/modeldb/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidymodels/modeldb?branch=main)\n[![Downloads](http://cranlogs.r-pkg.org/badges/modeldb)](https://CRAN.R-project.org/package=modeldb)\n\nFit models inside the database! **modeldb works with most database back-ends** because it leverages [dplyr](https://dplyr.tidyverse.org/) and [dbplyr](https://dbplyr.tidyverse.org/) for the final SQL translation of the algorithm. It currently supports:\n\n- K-means clustering\n\n- Linear regression\n\n## Installation\n\nInstall the CRAN version with:\n\n```{r, eval = FALSE}\ninstall.packages(\"modeldb\")\n```\n\nThe development version is available from GitHub using remotes:\n\n```{r, eval = FALSE}\n# install.packages(\"remotes\")\nremotes::install_github(\"tidymodels/modeldb\")\n```\n\n## Linear regression\n\nAn easy way to try out the package is by creating a temporary SQLite database, and loading `mtcars` to it.\n\n```{r}\ncon \u003c- DBI::dbConnect(RSQLite::SQLite(), path = \":memory:\")\nRSQLite::initExtension(con)\ndplyr::copy_to(con, mtcars)\n```\n\n```{r}\nlibrary(dplyr)\n\ntbl(con, \"mtcars\") %\u003e%\n  select(wt, mpg, qsec) %\u003e%\n  linear_regression_db(wt)\n```\n\nThe model output can be parsed by [tidypredict](https://tidypredict.tidymodels.org/) to run the predictions in the database. Please see the \"Linear Regression\" article to learn more about how to use `linear_regression_db()`\n\n## K Means clustering\n\nTo use the `simple_kmeans_db()` function, simply pipe the database back end table to the function.  This returns a list object that contains two items:\n\n- A sql query table with the final center assignment\n- A local table with the information about the centers\n\n```{r}\nkm \u003c- tbl(con, \"mtcars\") %\u003e%\n  simple_kmeans_db(mpg, wt)\n\ncolnames(km)\n```\n\nThe SQL statement from `tbl` can be extracted using dbplyr's `remote_query()`\n\n```{r}\ndbplyr::remote_query(km)\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 Posit 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/modeldb/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. Check out [this helpful article on how to create reprexes](https://dbplyr.tidyverse.org/articles/reprex.html) for problems involving a database.\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","funding_links":[],"categories":["Keras Cheatsheet","R"],"sub_categories":["Model Explaination"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidymodels%2Fmodeldb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftidymodels%2Fmodeldb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidymodels%2Fmodeldb/lists"}