語言分析與資料科學
  • 本書規劃
  • PART I:基礎知識
    • 導論
    • 語言學
      • 語言的實證研究方法
    • 數學與統計
      • 統計
        • 機率與機率分佈
          • 推論統計
        • 迴歸模型
      • 線性代數
    • 自然語言處理
      • 語料庫
    • 機器學習
      • kNN
      • Probabilistic learning using Naive Bayes
      • 決策樹 Decision Trees
      • 支持向量機 Support Vector Machines
      • 迴歸分析 Regression models
      • 神經網路與深度學習 Neural Network and Deep Learning
      • 關聯規則挖掘 Association Rules
      • k-means 分群 Clusterings
      • 社會網路分析
    • 資料科學的 OSEMN 模式
  • PART II: 文本分析:資料處理、表徵與語意計算
    • 文本分析是什麼
      • 程式處理架構
    • 文本前處理
      • 文本收集
      • 文本清理
      • 自動分詞與詞類標記
      • 文本標記
    • 文本數據探索性分析
    • 文本語意與統計
      • 語意表徵
      • 文本訊息視覺化
      • 文本相似與關聯
    • 文本知識抽取
  • PART III:文本分析:模型應用與專案
    • 文本迴歸預測
    • 文本分類
      • 情緒分析
      • 垃圾訊息偵測
    • 文本自動生成
      • 自動摘要
    • 文本聚類
    • 主題模型
    • 立場、意圖與價值
    • 個人文體風格
    • 文本真實性
      • 重複文本偵測
    • 資料科學報告與部署
  • 附錄
    • R 存活指令
    • Python 存活指令
    • Git and Github 入手
    • Linux 存活指令
    • 正則表示法
    • 參考書目
Powered by GitBook
On this page
  • 簡單線型迴歸
  • 線性迴歸 with R
  • Logistic 迴歸 with R
  • 多元(複)迴歸模型

Was this helpful?

  1. PART III:文本分析:模型應用與專案

文本迴歸預測

regression model

Text regression using tm and glmnet

簡單線型迴歸

線性迴歸 with R

# Load Train and Test datasets
# Identify feature and response variable(s);values must be numeric

x_train <- input_variables_values_training_datasets 
y_train <- target_variables_values_training_datasets 
x_test <- input_variables_values_test_datasets
x <- cbind(x_train, y_train)

# Train the model using the training sets and check score
linear <- lm(y_train ~ ., data = x)
summary(linear)
# Predict Output
predicted <- predict(linear,x_test)

Logistic 迴歸 with R

# Train the model using the training sets and check score
logistic <- glm(y_train ~ ., data = x,family = 'binomial')
summary(logistic)
# Predict Output
predicted <- predict(logistic, x_test)

多元(複)迴歸模型

  • 多了許多預測變數

Previous文本知識抽取Next文本分類

Last updated 5 years ago

Was this helpful?