{"id":19253611,"url":"https://github.com/tidymodels/agua","last_synced_at":"2025-04-21T14:32:10.832Z","repository":{"id":37684294,"uuid":"493420091","full_name":"tidymodels/agua","owner":"tidymodels","description":"Create and evaluate models using 'tidymodels' and 'h2o'","archived":false,"fork":false,"pushed_at":"2024-06-13T05:30:58.000Z","size":7701,"stargazers_count":22,"open_issues_count":5,"forks_count":2,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-19T03:57:29.437Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://agua.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":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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-17T21:33:48.000Z","updated_at":"2024-11-09T03:13:31.000Z","dependencies_parsed_at":"2024-04-02T17:49:59.038Z","dependency_job_id":"900f72a7-6d5b-47ed-84bf-0047f5a4ea91","html_url":"https://github.com/tidymodels/agua","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidymodels%2Fagua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidymodels%2Fagua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidymodels%2Fagua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidymodels%2Fagua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tidymodels","download_url":"https://codeload.github.com/tidymodels/agua/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250070289,"owners_count":21369847,"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":[],"created_at":"2024-11-09T18:32:08.911Z","updated_at":"2025-04-21T14:32:10.423Z","avatar_url":"https://github.com/tidymodels.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# agua \u003ca href=\"https://agua.tidymodels.org/\"\u003e\u003cimg src=\"man/figures/logo.svg\" align=\"right\" height=\"139\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![Codecov test coverage](https://codecov.io/gh/tidymodels/agua/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidymodels/agua?branch=main)\n[![R-CMD-check](https://github.com/tidymodels/agua/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidymodels/agua/actions/workflows/R-CMD-check.yaml)\n\u003c!-- badges: end --\u003e\n\nagua enables users to fit, optimize, and evaluate models via [H2O](https://h2o.ai/) using tidymodels syntax. Most users will not have to use aqua directly; the features can be accessed via the new parsnip computational engine `'h2o'`. \n\nThere are two main components in agua: \n\n* New parsnip engine `'h2o'` for many models, see [Get started](https://agua.tidymodels.org/articles/agua.html) for a complete list. \n\n* Infrastructure for the tune package. \n\nWhen fitting a parsnip model, the data are passed to the h2o server directly. For tuning, the data are passed once and instructions are given to `h2o.grid()` to process them. \n\nThis work is based on @stevenpawley's [h2oparsnip](https://github.com/stevenpawley/h2oparsnip) package. Additional work was done by Qiushi Yan for his 2022 summer internship at RStudio. \n\n## Installation\n\nThe CRAN version of the package can be installed via\n\n```r\ninstall.packages(\"agua\")\n```\n\nYou can also install the development version of agua using:\n\n``` r\nrequire(pak)\npak::pak(\"tidymodels/agua\")\n```\n\n## Examples\n\nThe following code demonstrates how to create a single model on the h2o server and how to make predictions. \n\n```r\nlibrary(tidymodels)\nlibrary(agua)\nlibrary(h2o)\ntidymodels_prefer()\n```\n\n```r\n# Start the h2o server before running models\nh2o_start()\n\n# Demonstrate fitting parsnip models: \n# Specify the type of model and the h2o engine \nspec \u003c-\n  rand_forest(mtry = 3, trees = 1000) %\u003e%\n  set_engine(\"h2o\") %\u003e%\n  set_mode(\"regression\")\n\n# Fit the model on the h2o server\nset.seed(1)\nmod \u003c- fit(spec, mpg ~ ., data = mtcars)\nmod\n#\u003e parsnip model object\n#\u003e \n#\u003e Model Details:\n#\u003e ==============\n#\u003e \n#\u003e H2ORegressionModel: drf\n#\u003e Model ID:  DRF_model_R_1656520956148_1 \n#\u003e Model Summary: \n#\u003e   number_of_trees number_of_internal_trees model_size_in_bytes min_depth\n#\u003e 1            1000                     1000              285914         4\n#\u003e   max_depth mean_depth min_leaves max_leaves mean_leaves\n#\u003e 1        10    6.70600         10         27    18.04100\n#\u003e \n#\u003e \n#\u003e H2ORegressionMetrics: drf\n#\u003e ** Reported on training data. **\n#\u003e ** Metrics reported on Out-Of-Bag training samples **\n#\u003e \n#\u003e MSE:  4.354249\n#\u003e RMSE:  2.086684\n#\u003e MAE:  1.657823\n#\u003e RMSLE:  0.09848976\n#\u003e Mean Residual Deviance :  4.354249\n\n# Predictions\npredict(mod, head(mtcars))\n#\u003e # A tibble: 6 × 1\n#\u003e   .pred\n#\u003e   \u003cdbl\u003e\n#\u003e 1  20.9\n#\u003e 2  20.8\n#\u003e 3  23.3\n#\u003e 4  20.4\n#\u003e 5  17.9\n#\u003e 6  18.7\n\n# When done\nh2o_end()\n```\n\nBefore using the `'h2o'` engine, users need to run `agua::h2o_start()` or `h2o::h2o.init()` to start the h2o server, which will be storing data, models, and other values passed from the R session. \n\nThere are several package vignettes including: \n\n- [Introduction to agua](https://agua.tidymodels.org/articles/agua.html)\n\n- [Model tuning](https://agua.tidymodels.org/articles/tune.html)\n\n- [Automatic machine learning](https://agua.tidymodels.org/articles/auto_ml.html)\n\n- [Parallel processing with agua and h2o](https://agua.tidymodels.org/articles/parallel.html)\n\n\n## Code of Conduct\n  \nPlease note that the agua 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidymodels%2Fagua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftidymodels%2Fagua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidymodels%2Fagua/lists"}