-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vfold_cv crashing/freezing the console #454
Comments
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() |
Hello!
I just took a screenshot if that's alright. I can attach an r script if that's better.
Best,
J
…________________________________
From: Emil Hvitfeldt ***@***.***>
Sent: Monday, August 28, 2023 3:10 PM
To: tidymodels/rsample ***@***.***>
Cc: godscloset ***@***.***>; Mention ***@***.***>
Subject: Re: [tidymodels/rsample] vfold_cv crashing/freezing the console (Issue #454)
Hello @godscloset<https://github.com/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()
—
Reply to this email directly, view it on GitHub<#454 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/APIFZGFTCFQ4T3WI4EUGEI3XXTULTANCNFSM6AAAAAA4BZXTJU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hey! I think you forgot to attach the screenshot :) |
It should be there! It's a .png titled 'tidymodels_sessioninfo'. I'll attach it again.
* J
…________________________________
From: Emil Hvitfeldt ***@***.***>
Sent: Monday, August 28, 2023 3:20 PM
To: tidymodels/rsample ***@***.***>
Cc: godscloset ***@***.***>; Mention ***@***.***>
Subject: Re: [tidymodels/rsample] vfold_cv crashing/freezing the console (Issue #454)
Hey! I think you forgot to attach the screenshot :)
—
Reply to this email directly, view it on GitHub<#454 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/APIFZGDCPSAXZTNFRDWMXUTXXTVRRANCNFSM6AAAAAA4BZXTJU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hi! |
when you say
|
Is there another way of inspecting list-style data frames? I realize this is not a rsample problem per se, but given that tidyverse uses lists a lot (nesting, etc), it would be very helpful to be able to look at them without crashing RStudio.
On Aug 29, 2023, at 10:13, Emil Hvitfeldt ***@***.***> wrote:
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.
—
Reply to this email directly, view it on GitHub<#454 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFUSNF2UKKOQN3DJWSLPI2TXXYPMFANCNFSM6AAAAAA4BZXTJU>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
To be clear, this is not a tidymodels problem, but a RStudio IDE issue. RStudio is slow/crashes when trying to 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 folds %>%
select(!where(is.list)) %>%
View() Another thing you could do is poke around with {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 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 |
Thank you, this is very useful. I mostly would like to be able to view lists in RStudio, such as those generated by |
Thanks for the discussion! I'm going to close as this is not an rsample issue. |
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. |
Hello,
Not sure if this is specific to my machine, but I've been trying to use functions from the 'rsample' package to split up my data, but when I try to view or do anything with the object it creates, the console (and all of R) freezes without any error messages. Initially, the column names for the vfold object are shown but the object is empty. This has happened with both bootstrap() and vfold_cv() from what I've tested. Let me know if this is just me!
Best,
Jacob
The text was updated successfully, but these errors were encountered: