We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
type = "prob" returns class predictions.
type = "prob"
library(tidymodels) library(tailor) set.seed(816) sim_data <- sim_classification(2000) %>% bind_cols(sim_noise(2000, 500)) sim_split <- initial_split(sim_data) sim_tr <- training(sim_split) sim_te <- testing(sim_split) rf_spec <- rand_forest() %>% set_mode("classification") rf_wflow <- workflow(class ~ ., rf_spec) cal_post <- tailor() %>% adjust_probability_calibration(method = "beta") rf_cal_wflow <- rf_wflow %>% add_tailor(cal_post, prop = .1) set.seed(456) rf_cal_fit <- fit(rf_cal_wflow, sim_tr) # augment() not ready yet predict(rf_cal_fit, sim_te) #> # A tibble: 500 × 1 #> .pred_class #> <fct> #> 1 class_2 #> 2 class_2 #> 3 class_2 #> 4 class_1 #> 5 class_1 #> 6 class_2 #> 7 class_1 #> 8 class_1 #> 9 class_2 #> 10 class_2 #> # ℹ 490 more rows predict(rf_cal_fit, sim_te, type = "prob") #> # A tibble: 500 × 1 #> .pred_class #> <fct> #> 1 class_2 #> 2 class_2 #> 3 class_2 #> 4 class_1 #> 5 class_1 #> 6 class_2 #> 7 class_1 #> 8 class_1 #> 9 class_2 #> 10 class_2 #> # ℹ 490 more rows
Created on 2024-09-20 with reprex v2.1.0
The text was updated successfully, but these errors were encountered:
It does appear to work when used inside of fit_resamples() though
fit_resamples()
Sorry, something went wrong.
No branches or pull requests
type = "prob"
returns class predictions.Created on 2024-09-20 with reprex v2.1.0
The text was updated successfully, but these errors were encountered: