Comments (12)
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.
from rsample.
Hey! I think you forgot to attach the screenshot :)
from rsample.
from rsample.
Oh I see what happened. I tried to reply via email and not through github.
-J
from rsample.
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.
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.
from rsample.
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.
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.
Thanks for the discussion! I'm going to close as this is not an rsample issue.
from rsample.
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)
- Sorting of strata in training data from initial_split
- Grouped resampling breaks with non-missing `strata = NULL` HOT 1
- `inner_split()`: keep everything inside of `split_args` or not? HOT 1
- inner_split(): better labels
- inner_split(): S3 method to retrive splitting arguments HOT 3
- inner_split(): no initial_split() arguments HOT 2
- inner_split(): global prop argument
- Update naming for elements relating to potato set
- audit for backticked package names
- Use cli errors for `R/bootci.R`
- Use cli errors for `R/caret.R`
- Use cli errors in `R/initial_validation_split.R`
- Use cli errors in `R/labels.R`
- Use cli errors in `R/make_groups.R`, `R/mc.R`, `R/nest.R`
- Use cli errors in `R/misc.R`
- Use cli errors in `R/permutations.R`, `R/reg_intervals.R`
- Use cli errors in `R/rset.R`
- Use cli errors in `R/rsplit.R`
- Use cli errors in `R/slide.R`
- Use cli errors in `R/tidy.R`, `R/validation_set.R`, `R/vfold.R`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rsample.