Skip to content
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

adding pretty method to validation_set() #463

Merged
merged 1 commit into from
Jan 10, 2024
Merged

Conversation

EmilHvitfeldt
Copy link
Member

to close #456

library(tidymodels) 

val_split <- initial_validation_split(mtcars)
val_set <- validation_set(val_split) 

pretty(val_set)
#> [1] "Validation Set (0.75/0.25)"

val_set_old <- validation_split(mtcars)
#> Warning: `validation_split()` was deprecated in rsample 1.2.0.
#> ℹ Please use `initial_validation_split()` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.

pretty(val_set_old)
#> [1] "Validation Set Split (0.75/0.25) "

Created on 2024-01-10 with reprex v2.0.2

Copy link
Contributor

@simonpcouch simonpcouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does the trick!🙂 With pak::pak(c("tidymodels/tune", "tidymodels/rsample#463")):

library(tidymodels) 

val_split <- initial_validation_split(mtcars) 
val_set <- validation_set(val_split) 

# fit_resamples() and tune_*() work with rsets
res <- fit_resamples(linear_reg(), mpg ~ ., resamples = val_set)

Created on 2024-01-10 with reprex v2.0.2

@EmilHvitfeldt EmilHvitfeldt merged commit e35e756 into main Jan 10, 2024
12 checks passed
@EmilHvitfeldt EmilHvitfeldt deleted the pretty-validation branch January 10, 2024 21:20
Copy link

This pull request 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.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add pretty() method for validation_set class
2 participants