{"repo":"tidymodels/modeldb","free":true,"listed":false,"github":"https://github.com/tidymodels/modeldb","clone":"git clone https://github.com/tidymodels/modeldb.git","description":"Run models inside a database using R","language":"R","stars":80,"topics":["dplyr","rlang","tidyeval","dbplyr","sql","modeling","database","visualization","ggplot2"],"license":null,"category":"databases-storage","readme_excerpt":"modeldb Fit models inside the database! modeldb works with most database back-ends because it leverages dplyr and dbplyr for the final SQL translation of the algorithm. It currently supports: - K-means clustering - Linear regression Installation Install the CRAN version with: The development version is available from GitHub using remotes: Linear regression An easy way to try out the package is by creating a temporary SQLite database, and loading mtcars to it. ## # A tibble: 1 × 3 ## (Intercept) mpg qsec ## ## 1 4.12 -0.156 0.125 The model output can be parsed by tidypredict to run the predictions in the database. Please see the “Linear Regression” article to learn more about how to use linear regression db() K Means clustering To 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: - A sql query table with the final center assignment - A local table with the information about the centers ## [1] \"k center\" \"k mpg\" \"k wt\" \"mpg\" \"cyl\" \"disp\" ## [7] \"hp\" \"drat\" \"wt\" \"qsec\" \"vs\" \"am\" ## [13] \"gear\" \"carb\" The SQL statement from tbl can be extracted using dbplyr’s remote query() ## SELECT ## LHS . k center AS k center , ## k mpg , ## k wt , ## mpg , ## cyl , ## disp , ## hp , ## drat , ## wt , ## qsec , ## vs , ## am , ## gear , ## carb ## FROM ( ## SELECT ## mpg , ## cyl , ## disp , ## hp , ## drat , ## wt , ## qsec , ## vs , ## am , ## gear , ## carb , ## center AS k center ## FROM ( ## S","default_branch":null,"files":null,"tree":[],"storefront":"/r/tidymodels","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/tidymodels/modeldb/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}