語言分析與資料科學
  • 本書規劃
  • 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
  • 機器學習基本想法
  • 爭論
  • 監督式學習 (Supervised learning)
  • 分類 Classification
  • 分群
  • 迴歸分析
  • 非監督式學習 (Supervised learning)
  • Reinforcement learning
  • Evaluation of Performance

Was this helpful?

  1. PART I:基礎知識

機器學習

machine learning

  • 監督式學習:分類(Classification)、迴歸分析(Regression)

  • 非監督式學習:分群(Clustering)

  • 訓練、測試與評估概念

機器學習基本想法

  • 從過往資料的特徵來對未知資料做預測判斷。

  • 例子:書籍或電影推薦、匯率預測、從臉書資料分類朋友人格

爭論

  • 機器學習通常涉及預測模型 (prediction models),而訓練 prediction models 通常需要有(人工)標記的資料 (labeled data),換句話說,機器可以學習的正確答案。

  • 但是有人工標記的資料(據說)耗時費事,重點是花錢,所以儘量不依賴人工標記的資料的作法漸漸受到歡迎。近年來深度學習神經網路演算法因為它在許多領域的成功,更是紅透半邊天。語言學與知識工程則打入冷宮。

爭論的底層其實涉及更深一層的哲學問題:知識和知識的表徵是什麼?
讓機器「自己學習」很酷,但是不知道機器學習的機制來自什麼人類認知機制
不是很危險的一件事?

另一種反擊(個人見解)

  • 花大錢的迷思:想想 wikipedia 是怎麼完成的?人類自己的無私熱情可以解決人類的處境。甚至 Game with a purpose 利用遊戲讓人不知不覺「標記」知識與常識也是個做法。

  • 大數據的假說 (let big data speak for themselves):巨量資料中的雜訊可以在計算過程中被處理。在文本處理是否如此需要證明!

  • Active Learning attempts to reduce the number of labeled data needed for training the model. 把 label 當成是成本問題。

    1. Classify the document using the current decision model. Let CCC be the assigned category.

    2. If Prob(C)<Prob(C) <Prob(C)< threshold, request a label; otherwise, ignore the document.

Experimenting with text categorization and with some numerical data-mining applications, researchers have found that active learning can often drastically reduce their overall sample size while achieving results comparable to training on the full set of labeled documents.(Weiss et al. 2005)

監督式學習 (Supervised learning)

  • 資料前處理(準備好訓練與測試語料)

  • 訓練機器學習模式

  • 測試與效能評估

  • 分析與參數調整,重新建模

# 載入訓練與測試語料 
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 evaluate

分類 Classification

  • 給訂標記好的資料,選用分類演算法訓練分類器,用來預測新資料的所屬的類別。

分群

  • 組內差異小、組間差異大的預設

迴歸分析

Random Forest

# Import required Library
library(randomForest)
# Fitting model
fit <- randomForest(Species ~ ., x, ntree = 500) 
summary(fit)
# Predict Output
predicted <- predict(fit, x_test)

Gradient Boosting and AdaBoost

library(caret)
# Fitting model
fitControl <- trainControl(method = "repeatedcv", number = 4, repeats = 4)
fit <- train(y ~ ., data = x, method = "gbm", trControl = fitControl, verbose = FALSE) 
predicted <- predict(fit, x_test, type= "prob")[,2]

非監督式學習 (Supervised learning)

  • 降維技術 (PCA, ...)

library(stats)
pca <- princomp(train, cor = TRUE) 
train_reduced <- predict(pca, train) 
test_reduced <- predict(pca, test)

Hierarchical Clustering

Reinforcement learning

Markov Decision Process

Evaluation of Performance

評量機器學習模型的表現

深入鑽研

Previous語料庫NextkNN

Last updated 5 years ago

Was this helpful?

Andrew Ng, Machine Learning
Johns Hopkins University, Practical Machine Learning
林軒田,機器學習基石
林軒田,機器學習技法