Git Product home page Git Product logo

brulee's Introduction

brulee a dish of creme brulee on a striped background

R-CMD-check Codecov test coverage Lifecycle: experimental

The R brulee package contains several basic modeling functions that use the torch package infrastructure, such as:

Installation

You can install the released version of brulee from CRAN with:

install.packages("brulee")

And the development version from GitHub with:

# install.packages("pak")
pak::pak("tidymodels/brulee")

Example

brulee has formula, x/y, and recipe user interfaces for each function. For example:

library(brulee)
library(recipes)
library(yardstick)

data(bivariate, package = "modeldata")
set.seed(20)
nn_log_biv <- brulee_mlp(Class ~ log(A) + log(B), data = bivariate_train, 
                         epochs = 150, hidden_units = 3)

# We use the tidymodels semantics to always return a tibble when predicting
predict(nn_log_biv, bivariate_test, type = "prob") %>% 
  bind_cols(bivariate_test) %>% 
  roc_auc(Class, .pred_One)
#> # A tibble: 1 × 3
#>   .metric .estimator .estimate
#>   <chr>   <chr>          <dbl>
#> 1 roc_auc binary         0.837

A recipe can also be used if the data require some sort of preprocessing (e.g., indicator variables, transformations, or standardization):

library(recipes)

rec <- 
  recipe(Class ~ ., data = bivariate_train) %>%  
  step_YeoJohnson(all_numeric_predictors()) %>% 
  step_normalize(all_numeric_predictors())

set.seed(20)
nn_rec_biv <- brulee_mlp(rec, data = bivariate_train, 
                         epochs = 150, hidden_units = 3)

# A little better
predict(nn_rec_biv, bivariate_test, type = "prob") %>% 
  bind_cols(bivariate_test) %>% 
  roc_auc(Class, .pred_One)
#> # A tibble: 1 × 3
#>   .metric .estimator .estimate
#>   <chr>   <chr>          <dbl>
#> 1 roc_auc binary         0.866

Code of Conduct

Please note that the brulee project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

brulee's People

Contributors

dfalbel avatar emilhvitfeldt avatar hfrick avatar hsbadr avatar jrosell avatar juliasilge avatar topepo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.