Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
NotificationsYou must be signed in to change notification settings

tidymodels/agua

Repository files navigation

Codecov test coverageR-CMD-check

agua enables users to fit, optimize, and evaluate models viaH2O using tidymodels syntax. Most users will not haveto use aqua directly; the features can be accessed via the new parsnipcomputational engine'h2o'.

There are two main components in agua:

  • New parsnip engine'h2o' for many models, seeGetstarted for acomplete list.

  • Infrastructure for the tune package.

When fitting a parsnip model, the data are passed to the h2o serverdirectly. For tuning, the data are passed once and instructions aregiven toh2o.grid() to process them.

This work is based on @stevenpawley’sh2oparsnip package.Additional work was done by Qiushi Yan for his 2022 summer internship atRStudio.

Installation

The CRAN version of the package can be installed via

install.packages("agua")

You can also install the development version of agua using:

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

Examples

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

library(tidymodels)library(agua)library(h2o)tidymodels_prefer()
# Start the h2o server before running modelsh2o_start()# Demonstrate fitting parsnip models:# Specify the type of model and the h2o enginespec<-  rand_forest(mtry=3,trees=1000) %>%  set_engine("h2o") %>%  set_mode("regression")# Fit the model on the h2o serverset.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# Predictionspredict(mod, head(mtcars))#> # A tibble: 6 × 1#>   .pred#>   <dbl>#> 1  20.9#> 2  20.8#> 3  23.3#> 4  20.4#> 5  17.9#> 6  18.7# When doneh2o_end()

Before using the'h2o' engine, users need to runagua::h2o_start()orh2o::h2o.init() to start the h2o server, which will be storingdata, models, and other values passed from the R session.

There are several package vignettes including:

Code of Conduct

Please note that the agua project is released with aContributor CodeofConduct.By contributing to this project, you agree to abide by its terms.

About

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

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors5

Languages


[8]ページ先頭

©2009-2025 Movatter.jp