agua

Create and evaluate models using 'tidymodels' and 'h2o'

https://github.com/tidymodels/agua

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.4%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Create and evaluate models using 'tidymodels' and 'h2o'

Basic Info
Statistics
  • Stars: 23
  • Watchers: 7
  • Forks: 2
  • Open Issues: 6
  • Releases: 3
Created about 4 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog License Code of conduct

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# agua 


[![Codecov test coverage](https://codecov.io/gh/tidymodels/agua/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidymodels/agua?branch=main)
[![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)


agua 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'`. 

There are two main components in agua: 

* New parsnip engine `'h2o'` for many models, see [Get started](https://agua.tidymodels.org/articles/agua.html) for a complete list. 

* Infrastructure for the tune package. 

When 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. 

This 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. 

## Installation

The CRAN version of the package can be installed via

```r
install.packages("agua")
```

You can also install the development version of agua using:

``` r
require(pak)
pak::pak("tidymodels/agua")
```

## Examples

The following code demonstrates how to create a single model on the h2o server and how to make predictions. 

```r
library(tidymodels)
library(agua)
library(h2o)
tidymodels_prefer()
```

```r
# Start the h2o server before running models
h2o_start()

# Demonstrate fitting parsnip models: 
# Specify the type of model and the h2o engine 
spec <-
  rand_forest(mtry = 3, trees = 1000) %>%
  set_engine("h2o") %>%
  set_mode("regression")

# Fit the model on the h2o server
set.seed(1)
mod <- fit(spec, mpg ~ ., data = mtcars)
mod
#> parsnip model object
#> 
#> Model Details:
#> ==============
#> 
#> H2ORegressionModel: drf
#> Model ID:  DRF_model_R_1656520956148_1 
#> Model Summary: 
#>   number_of_trees number_of_internal_trees model_size_in_bytes min_depth
#> 1            1000                     1000              285914         4
#>   max_depth mean_depth min_leaves max_leaves mean_leaves
#> 1        10    6.70600         10         27    18.04100
#> 
#> 
#> H2ORegressionMetrics: drf
#> ** Reported on training data. **
#> ** Metrics reported on Out-Of-Bag training samples **
#> 
#> MSE:  4.354249
#> RMSE:  2.086684
#> MAE:  1.657823
#> RMSLE:  0.09848976
#> Mean Residual Deviance :  4.354249

# Predictions
predict(mod, head(mtcars))
#> # A tibble: 6 × 1
#>   .pred
#>   
#> 1  20.9
#> 2  20.8
#> 3  23.3
#> 4  20.4
#> 5  17.9
#> 6  18.7

# When done
h2o_end()
```

Before 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. 

There are several package vignettes including: 

- [Introduction to agua](https://agua.tidymodels.org/articles/agua.html)

- [Model tuning](https://agua.tidymodels.org/articles/tune.html)

- [Automatic machine learning](https://agua.tidymodels.org/articles/auto_ml.html)

- [Parallel processing with agua and h2o](https://agua.tidymodels.org/articles/parallel.html)


## Code of Conduct
  
Please 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.

Owner

  • Name: tidymodels
  • Login: tidymodels
  • Kind: organization

GitHub Events

Total
  • Issues event: 1
  • Watch event: 1
  • Push event: 6
  • Create event: 1
Last Year
  • Issues event: 1
  • Watch event: 1
  • Push event: 6
  • Create event: 1

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 27
  • Total pull requests: 29
  • Average time to close issues: 2 months
  • Average time to close pull requests: 11 days
  • Total issue authors: 9
  • Total pull request authors: 5
  • Average comments per issue: 2.41
  • Average comments per pull request: 1.38
  • Merged pull requests: 24
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • topepo (12)
  • qiushiyan (7)
  • simonpcouch (2)
  • coforfe (1)
  • jeliason (1)
  • TheMadHatter666 (1)
  • hfrick (1)
  • gouthaman87 (1)
  • EmilHvitfeldt (1)
Pull Request Authors
  • qiushiyan (16)
  • simonpcouch (5)
  • topepo (5)
  • hfrick (3)
  • gvelasq (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 909 last-month
  • Total docker downloads: 8
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 9
  • Total maintainers: 1
proxy.golang.org: github.com/tidymodels/agua
  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.5%
Average: 5.7%
Dependent repos count: 5.9%
Last synced: 10 months ago
cran.r-project.org: agua

'tidymodels' Integration with 'h2o'

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 909 Last month
  • Docker Downloads: 8
Rankings
Stargazers count: 13.8%
Downloads: 19.5%
Average: 25.5%
Forks count: 28.8%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Maintainers (1)
Last synced: 10 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/lock.yaml actions
  • dessant/lock-threads v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/pr-fetch v2 composite
  • r-lib/actions/pr-push v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • parsnip * depends
  • cli * imports
  • dials * imports
  • dplyr * imports
  • generics >= 0.1.3 imports
  • ggplot2 * imports
  • glue * imports
  • h2o >= 3.38.0.1 imports
  • hardhat >= 1.1.0 imports
  • methods * imports
  • pkgconfig * imports
  • purrr * imports
  • rlang * imports
  • rsample * imports
  • stats * imports
  • tibble * imports
  • tidyr * imports
  • tune >= 1.0.1 imports
  • vctrs * imports
  • workflows * imports
  • covr * suggests
  • knitr * suggests
  • modeldata * suggests
  • recipes * suggests
  • rmarkdown * suggests
  • testthat >= 3.0.0 suggests