Open utterances-bot opened 3 years ago
Hello Julia, Thank you very much for the great screencasts. I am a new leaner who avidly follow your screencasts. While running the bake code, I ran to the following error. I appreciate it if you assist me on how to deal with this problem.
post_rec %>%
- prep() %>%
- bake(new_data = NULL) Error: Not enough observations of 'MI/OH' to perform SMOTE. Run
rlang::last_error()
to see where the error occurred. And the rlang:: rlang::last_error() <error/rlang_error> Not enough observations of 'MI/OH' to perform SMOTE. Backtrace:
- post_rec %>% prep() %>% bake(new_data = NULL)
- recipes:::prep.recipe(.)
- themis:::bake.step_smote(x$steps[[i]], new_data = training)
- themis:::smote(...) Run
rlang::last_trace()
to see the full context.Thank you again.
@Heseraj I suspect you didn't set up a new state
variable that is only Hawaii/Other, and that your state
variable still has all the original values in it still. I set up that with this code:
po_split <- post_offices %>%
mutate(state = case_when(
state == "HI" ~ "Hawaii",
TRUE ~ "Other"
)) %>%
select(name, state) %>%
initial_split(strate = state)
Great post! I always learn something new from your screencast. I didn't know I could use expressions in group_by
@juliasilge, Hi Julia, at the end of this screencast we have some words that have positive estimate and other have negative estimate in which i think the more positive estimate the more likely the post office that have these words in their name will from Hawaii, however your comment is in opposite direction. Could you explain it in more detail?
@conlelevn Hmmmm, I'm pretty sure I got it right, based on the results we see (more from Hawaii starting with H, K, containing ALE, etc). The sign here on these is related to which level (Hawaii vs. other) is considered the base level (or first level, or positive case) by the model.
Which #TidyTuesday post offices are in Hawaii? | Julia Silge
Use tidymodels to predict post office location with subword features and a support vector machine model.
https://juliasilge.com/blog/hawaii-post-offices/