我一直在用 tidymodels 为 Animal Crossing 用户评论 ( https://www.youtube.com/watch?v=whE85O1XCkg&t=1300s )从他的 Youtube 情感分析视频中复制 Julia Silge 的代码。在第 25 分钟,她使用 tune_grid(),当我尝试在我的脚本中使用它时,出现以下警告/错误:警告消息:所有模型在 tune_grid() 中失败。见.notes专栏。
在 .notes 中,出现 25 次:
[[1]]
# A tibble: 1 x 1
.notes
<chr>
1 "recipe: Error in UseMethod(\"prep\"): no applicable method for 'prep' applied~
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题?我使用的代码与 Julia 使用的代码相同。我的整个代码是这样的:
library(tidyverse)
user_reviews <- read_tsv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-05-05/user_reviews.tsv")
Run Code Online (Sandbox Code Playgroud)
user_reviews %>%
count(grade) %>%
ggplot(aes(grade,n)) +
geom_col()
Run Code Online (Sandbox Code Playgroud)
user_reviews %>%
filter(grade > 0) %>%
sample_n(5) %>%
pull(text)
Run Code Online (Sandbox Code Playgroud)
reviews_parsed <- user_reviews %>%
mutate(text = str_remove(text, "Expand"),
rating = case_when(grade …Run Code Online (Sandbox Code Playgroud) r sentiment-analysis hyperparameters data-science tidymodels