Giter VIP home page Giter VIP logo

Comments (12)

EmilHvitfeldt avatar EmilHvitfeldt commented on August 10, 2024

Hello @godscloset ! That is unfortunate, it should definitely work! Can you run the following code for me and show us the results? I wanna make sure you are using up to date versions of the packages

library(tidymodels)

sessionInfo()

from rsample.

godscloset avatar godscloset commented on August 10, 2024

from rsample.

EmilHvitfeldt avatar EmilHvitfeldt commented on August 10, 2024

Hey! I think you forgot to attach the screenshot :)

from rsample.

godscloset avatar godscloset commented on August 10, 2024

from rsample.

godscloset avatar godscloset commented on August 10, 2024

tidymodels_sessioninfo

Oh I see what happened. I tried to reply via email and not through github.

-J

from rsample.

godscloset avatar godscloset commented on August 10, 2024

Hi!
Another revelation: it seems like when I try to 'view' the created vfold object is when everything breaks down. Weirdly, this was working before but now causes the crash-- I don't know if this helps.
-Jacob

from rsample.

EmilHvitfeldt avatar EmilHvitfeldt commented on August 10, 2024

when you say view do you mean using the View() function, or having the object printed to the console?

View() doesn't handle non-standard data.frames very well and is not recommended to be used on tidymodels objects.

from rsample.

cportner avatar cportner commented on August 10, 2024

from rsample.

EmilHvitfeldt avatar EmilHvitfeldt commented on August 10, 2024

To be clear, this is not a tidymodels problem, but a RStudio IDE issue. RStudio is slow/crashes when trying to View() a data.frame with list columns rstudio/rstudio#2039.

We understand the frustration, which is why we generally discourage working with list-columns directly. The {tune} package has collect_*() functions that allow you to extract wanted information to a non-list-column-data.frame.

If you still want to see what happens with your data while working with list columns you can unselect them before using View()

folds %>%
  select(!where(is.list)) %>%
  View()

Another thing you could do is poke around with str(folds, max.level = 1) while slowly increasing max.level to avoid massive printing. I personally also enjoy using glimpse() for data.frames.

{recipes} objects themselves are not that great to look at for the user, as they contain quite a bit of information. If you were to investigate I would encourage the use of tidy() as an extracting function, and turn the data into a viewable format

library(tidymodels)
library(modeldata)
data(meats)

norm_rec <- 
  recipe(water + fat + protein ~ ., data = meats) %>%
  step_normalize(all_predictors()) 

set.seed(57343)
folds <- vfold_cv(meats, repeats = 10)

folds <- 
  folds %>%
  mutate(recipes = map(splits, prepper, recipe = norm_rec))

folds %>%
  mutate(recipes = map(splits, prepper, recipe = norm_rec)) %>%
  mutate(tidy = map(recipes, tidy, 1)) %>%
  select(-splits, -recipes) %>%
  rename(repeat_id = id) %>%
  unnest(tidy)
#> # A tibble: 20,000 × 6
#>    repeat_id id2    terms statistic value id             
#>    <chr>     <chr>  <chr> <chr>     <dbl> <chr>          
#>  1 Repeat01  Fold01 x_001 mean       2.82 normalize_CiSI9
#>  2 Repeat01  Fold01 x_002 mean       2.82 normalize_CiSI9
#>  3 Repeat01  Fold01 x_003 mean       2.83 normalize_CiSI9
#>  4 Repeat01  Fold01 x_004 mean       2.83 normalize_CiSI9
#>  5 Repeat01  Fold01 x_005 mean       2.83 normalize_CiSI9
#>  6 Repeat01  Fold01 x_006 mean       2.84 normalize_CiSI9
#>  7 Repeat01  Fold01 x_007 mean       2.84 normalize_CiSI9
#>  8 Repeat01  Fold01 x_008 mean       2.84 normalize_CiSI9
#>  9 Repeat01  Fold01 x_009 mean       2.85 normalize_CiSI9
#> 10 Repeat01  Fold01 x_010 mean       2.85 normalize_CiSI9
#> # ℹ 19,990 more rows

May I act what information you were hoping to see when calling View() on folds in the example above?

from rsample.

cportner avatar cportner commented on August 10, 2024

Thank you, this is very useful.

I mostly would like to be able to view lists in RStudio, such as those generated by rsample for bootstrapping and after nesting. I guess my problem is that I still have a hard time wrapping my head around exactly what information is at what "level" and what the different subparts contain.

from rsample.

hfrick avatar hfrick commented on August 10, 2024

Thanks for the discussion! I'm going to close as this is not an rsample issue.

from rsample.

github-actions avatar github-actions commented on August 10, 2024

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

from rsample.

Related Issues (20)

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.