You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm predicting a variable with levels 0 and 1 where I've ordered the factors so 1 is first. When using orbital, the predicted probability returned is the probability of seeing "0" but I would expect it to be the first level.
In the example below, you can see the difference between predicting with predict on the fitted workflow vs predicting using the orbital object. I expected the orbital object to predict .pred_1 but it is predicting .pred_0.
Reproducible example
library(orbital)
library(tidymodels)
library(dplyr)
hotels<-readr::read_csv("https://tidymodels.org/start/case-study/hotels.csv") %>%
mutate(across(where(is.character), as.factor)) %>%
mutate(children=if_else(children=="children", 1, 0) %>% factor(levels=c(1,0))) %>%
select(-arrival_date )
#> Rows: 50000 Columns: 23#> ── Column specification ────────────────────────────────────────────────────────#> Delimiter: ","#> chr (11): hotel, children, meal, country, market_segment, distribution_chan...#> dbl (11): lead_time, stays_in_weekend_nights, stays_in_week_nights, adults,...#> date (1): arrival_date#> #> ℹ Use `spec()` to retrieve the full column specification for this data.#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
hotels %>% count(children)
#> # A tibble: 2 × 2#> children n#> <fct> <int>#> 1 1 4038#> 2 0 45962
what is happening here is that {orbital} is not supporting any classification models YET. But for some reason, it still worked and was treated as a regression model, which is a bug and will be fixed.
The problem
I'm predicting a variable with levels 0 and 1 where I've ordered the factors so 1 is first. When using orbital, the predicted probability returned is the probability of seeing "0" but I would expect it to be the first level.
In the example below, you can see the difference between predicting with predict on the fitted workflow vs predicting using the orbital object. I expected the orbital object to predict
.pred_1
but it is predicting.pred_0
.Reproducible example
Created on 2024-08-28 with reprex v2.1.0
Session info
The text was updated successfully, but these errors were encountered: