[英]What R packages are available for binary data that is both correlated and clustered?
[英]What R package is suited to identifying words that are positively correlated with a binary response variable
我有一個包含三列的小標題:
如果我有興趣識別往往出現在頂級葡萄酒中的單詞(目標變量 = 1),我可能會使用 R package
我在 R Text Mining with R中遇到了 Text Mining ,但這似乎更多是關於情感分析,這似乎接近我想要實現的目標,但可能有點離題。 任何建議都會受到歡迎。
我的工作假設是,一旦我完成了一些基本分析,我就能夠將其納入邏輯回歸中。
您可以使用tidymodels框架進行這種建模,使用textrecipes package 進行數據預處理。 你最終會得到看起來像這樣的建模。
## ══Workflow════════════════════════════════════════════════════════════════
## Preprocessor: Recipe
## Model: logistic_reg()
##
## ── Preprocessor ────────────────────────────────────────────────────────────
## 5 Recipe Steps
##
## ● step_tokenize()
## ● step_stopwords()
## ● step_tokenfilter()
## ● step_tfidf()
## ● step_normalize()
##
## ── Model ───────────────────────────────────────────────────────────────────
## Logistic Regression Model Specification (classification)
##
## Main Arguments:
## penalty = tune()
## mixture = 1
##
## Computational engine: glmnet
查看這個最近的教程以獲取更多詳細信息。
一個最小的工作示例會很好。 據我所知,您只需要一個 package 將您的數據轉換為文檔特征矩陣(dfm),使用您的 wine_description 變量作為文本字段。 我喜歡Quanteda這樣做。
以 dfm 作為預測變量的邏輯回歸將成為識別哪些詞用於描述頂級葡萄酒的一種方法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.