Giter Site home page Giter Site logo

user2018's Introduction

user2018

If you need to use a remote version of R to run the code, go to:

http://colorado.rstudio.com/rsc/classroom-assignment/

If you require a server instance, please let us know before going here. We will have to assign you an ID.

Slides and code for the 2018 useR! tutorial "Recipes for Data Processing" on Tuesday July 10th at 1:30:

R has an excellent framework for specifying models using formulas. While elegant and useful, it was designed in a time when models had small numbers of terms and complex preprocessing of data was not commonplace. As such, it has some limitations. In this tutorial, a new package called recipes is shown where the specification of model terms and preprocessing steps can be enumerated sequentially. The recipe can be estimated and applied to any dataset. Current options include simple transformations (log, Box-Cox, interactions, dummy variables, ...), signal extraction (PCA, PLS, ICA, MDS, ...), basis functions (splines, polynomials, ...), imputation methods, and others. An example is used to demonstrate the functionality.

The audience should include people who do feature engineering or need to include preprocessing with their models. From a technical standpoint, some experience in modeling and R is a good idea. Basic tidyverse syntax will be reviewed.

The materials will be added a few days before the tutorial. To install the required packages:

install.packages(
  c('AmesHousing', 'broom', 'kknn', 'recipes', 'rsample', 'tidyverse', 'yardstick'), 
  repos = "http://cran.r-project.org"
)

# and optionally

install.packages('caret', repos = "http://cran.r-project.org")

If you have trouble with any of these, email me at [email protected].

user2018's People

Contributors

topepo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

user2018's Issues

Error: "Evaluation error: No tidyselect variables were registered", when "assess_prediction" function is used

Hi,
I am facing a problem running the "assess_prediction" function from slide 41. It gives the following error when I map it to the cv_splits object

Error in mutate_impl(.data, dots) : 
  Evaluation error: No tidyselect variables were registered
Call `rlang::last_error()` to see a backtrace.
In addition: Warning message:
Please use `new_data` instead of `newdata` with `bake`. 
In recipes versions >= 0.1.4, this will cause an error.  

When I made a slight modification to the function by removing everything() argument from bake() as shown below

assess_predictions <- function(split_obj, rec_obj, mod_obj) {
  raw_data <- assessment(split_obj)
  proc_x <- bake(rec_obj, newdata = raw_data, all_predictors())
  # Now save _all_ of the columns and add predictions. 
  bake(rec_obj, newdata = raw_data) %>%
    mutate(
      .fitted = predict(mod_obj, newdata = proc_x),
      .resid = Sale_Price - .fitted,  # Sale_Price is already logged by the recipe
      # Save the original row number of the data
      .row = as.integer(split_obj, data = "assessment")
    )
}

the function worked fine!

Would you please help me interpret the error and why it only worked after removing everything() ?

Thanks

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.