supervise learning mining the web - chapter 5

32
SUPERVISE LEARNING Mining the Web - Chapter 5 Dao Vinh Ninh 2005/5/30

Upload: ezhno

Post on 16-Jan-2016

38 views

Category:

Documents


1 download

DESCRIPTION

SUPERVISE LEARNING Mining the Web - Chapter 5. Dao Vinh Ninh 2005/5/30. 発表の内容. Bayesian Learners Naïve Bayes Learners Bayesian Networks Maximum Entropy Learner Discriminative Classification Linear Least-Square Regression Support Vector Machine. The Supervised Learning Scenario. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: SUPERVISE LEARNING Mining the Web - Chapter 5

SUPERVISE LEARNINGMining the Web - Chapter 5Dao Vinh Ninh

2005/5/30

Page 2: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 2

発表の内容 Bayesian Learners

Naïve Bayes Learners Bayesian Networks

Maximum Entropy Learner Discriminative Classification

Linear Least-Square Regression Support Vector Machine

Page 3: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 3

The Supervised Learning Scenario

練習のドキュメントはトピック事に分類された標準ドキュメントである。練習ドキュメントにより各トピックの特性を調べ、トピックの特性に基いてドキュメントを分類する。

Page 4: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 4

Bayesian Learners 概要

確率モデル ドキュメントの生成は確率現象 テキスト分類に最も実践的な方法

前提の仮説 1つのドキュメントは1つのトピックに属する トピック「c」の選択される確率は Pr(c) 「優先確率」 トピック「c」でトークン「t」の出現確率は Pr(t|c) トピック「c」でドキュメント「d」の生成確率は Pr

(d|c)

Page 5: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 5

Bayesian Learners の仕組み パラメタを推定する

練習ドキュメントから各トピック毎に各トークンの出現確率 Pr(t|c) を計算できる。 Pr(t|c) の集合を「 Θ 」とする。

ドキュメントの生成確率を計算する パラメタ「 Θ 」に基いて各トピックにおけるテストド

キュメントの生成確率 Pr(d|c) を計算できる。 トピックを推定する

テストドキュメントの属すべきトピックをベイズ規則に基いて調べる。

)|Pr()Pr(

)|Pr()Pr()|Pr(

d

cdcdc

Page 6: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 6

Bayesian LearnersParameter Estimation パラメタ集合「 Θ 」の推定

既知値 練習ドキュメント集合「 D 」を調べて、パラメタの値を

推定する

上記の式は実際に計算不可能 Maximum Likelihood Estimate - MLE

総(積分)の値を計算しやすい値 arg maxPr(D|Θ) に変更 分類結果はよくない

)|Pr(),|Pr()|Pr(

),|Pr()|Pr()|Pr(

)|Pr(),|Pr()|Pr(

Dd

cdcdc

Ddcdc

Page 7: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 7

Bayesian LearnersNaïve Bayes Learners 概念

簡単、速い、更新しやすい モデルの仮説

トークンの出現は独立 応用したモデル

Binary Model Multinomial Model

Page 8: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 8

Naïve Bayes Learners Binary Model

トピック「c」にあるドキュメントの中でトークン「t」が出現確立は

Multinomial Model トピック「c」にあるドキュメントの中でトークン「t」

が一回ごとに出現確率は   ドキュメントの長さを「 L 」とする。

tc,

Ddfor account to

,,

,

,,, )1(

1)1()|Pr(

Wttc

dt tc

tc

dtWttc

dttccd

dt

tdnt

dddd tdn

lclLcldclLcd ),(

)},({)|Pr(),|Pr()|Pr()|Pr(

tc,

Page 9: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 9

Naïve Bayes Learners 問題

多くの小さいパラメタの積とることで、生成確率の値が極めて小さくなる⇒解決:対数を取る

パラメタ 練習ドキュメントの中に表さないトークンは ML

E 法により出現確率が「 0 」になる そのトークンを含むドキュメントの出現確率は

「 0 」にされる。

Page 10: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 10

Naïve Bayes Learners

Parameter Smoothing Binary Model

Multinomial Model

2

~

n

k Laplace’s law of succession: λ=1Lidstone’s law of succession: λ=heuristic

dDd

Ddtc

c

c

dnW

tdn

,

, ),(||

),(1

W :トークンの数

Page 11: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 11

Naïve Bayes Learners の評価

Multinomial Model は Binary Model よりも正確

K-NN Model は Naïve Bayes Model よりも正確

ただし、 Naïve Bayes Model は k-NN Modelよりも簡潔で速い

Naïve Bayes Model に各トピックの間に等しい生成確率のファイルゾーンが存在する。

各トークンの間の関係を無視した。

Page 12: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 12

Bayesian LearnersSmall-Degree Bayesian Networks 各トークンの間の関係をモデルに追加する

各トークンの出現確率はトピックと他のトークンの出現に影響される。

Bayesian Network 各トピックとトークンはグラフのノード 依存関係はエージで表す 各トークンは必ず直接に1つのトピックノード

を通る

Page 13: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 13

Bayesian networks. For the naive Bayes assumption, the only edges are from the classvariable to individual terms. Towards better approximations to the joint distribution over terms:the probability of a term occurring may now depend on observation about other terms as well as the class variable.

Page 14: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 14

Small-Degree Bayesian Networks

関連のあるトークンを親トークン「 Pa(x) 」といい、親トークンの数を「k」個以下と制限される。 親トークンが定まるとそのトークンの出現確率も定まる。

ドキュメントの生成確率は各条件付確率で計算される。

現在 Binary Model だけを用いる。 計算時間 2 乗オーダー 結果はよくなったがテキストドキュメントに対して

はまだ

x

Xpaxcd ))(|Pr()|Pr(

Page 15: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 15

Maximum Entropy Learners

解決すること Bayesian Learners で訓練集合のベクトル空間の次元はテ

ストドキュメントの次元よりも小さい 新たしいフィーチャを追加することが出来ない

仮説 ドキュメントは 1 つのトピックに属する。 訓練のデータ集合            が与える。 ドキュメント「 d 」とトピック「 c 」の間の関係は indica

tor function    で定義する。例:

},...,1),,{( nicd ii ),( cdfj

otherwise 0

d tand c’c if 1),(,' cdf tc

otherwise ),(

),( c’c if 0

),(,'

dntdn

cdf tcまたは

Page 16: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 16

Maximum Entropy Learners

Indicator function  の期待値

Pr(d,c) と Pr(d) の値は経験値で推定する。

ランダム

cd d c

jjj cdfdcdcdfcdfE,

),()|Pr()Pr(),(),Pr()(

),( cdfj

i c

ijiiiij

iii cdfdcdcdfcd ),()|Pr()r(P

~),(),r(P

~

i c

ijii

iij cdfdcn

cdfn

),()|Pr(1

),(1

Page 17: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 17

Maximum Entropy Learners

上記の関連で Pr(c|d) は唯一ではない 最大エントロピー原理

同じ結果ならば最も簡単なモデルが好ましい Pr(c|d) が唯一ではないときは最もエントロピーが高い結果

を選ぶ 訓練集合が空の場合、全てのトピックは同等 Pr(c|d) のエントロピー

Lagrange 法でエントロピー最大値を求める

cd

dcdcd,

)|Pr(log)|Pr()Pr(

Page 18: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 18

Maximum Entropy Learners

Lagrange   Optimize

Pr(c|d) に対して G を微分する

等しい問題は以下のMLを求めること

cd

dcdcddcG,

)|Pr(log)|Pr()Pr()),|(Pr(

)),()|Pr(),((, ci

ijiiiij

j

j cdfdccdf

j

cdfjj

dZdc ),(

)(

1)|Pr( Z(d) is a scale factor

jej

Dd

d dc )|Pr(logmaximise

Page 19: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 19

Maximum Entropy Learners

評価 Bayesian Learners よりも良い分類結果だが、安

定していない 複雑 Naïve Bayes Learners と同じフィーチャを用い

るにも関わらず、各フィーチャの独立性に依存しない。

Page 20: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 20

Discriminative Classification

解決すること Naïve Bayes Learners と Maximum Entropy Learners 法は

各トピックの間に共通空間が存在する。 Naïve Bayes

Maximum Entropy 目的

フィーチャをトピック空間に射影する 共通空間を無くすること

Dt

tctdncdc ,log),()Pr(log~)|Pr(log

Dt

tctcd cdfZdc ,, log),(log)|Pr(log

Page 21: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 21

Discriminative ClassificationLinear Least-Square Regression 各トピックは数字にエンコードする。 ドキュメントを分類する関数を先に定義する。

ドキュメント「d」に対して、関数  α・d+b でトピック空間に射影する。

訓練ドキュメントに対して、エラーが最小になる様に各パラメタを調整する。 Minimum

Widrow-Hoff 更新規則

iii cbd 2).(

iiiiii dcd ).(2 )1()1()(

Page 22: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 22

Linear Least-Square Regression

解釈 分別方程式は一つの面と考えられて、各ドキュメ

ントをその面で分けることになる。その面ことをハイパー面という。

または、各ドキュメントはその面に垂直なベクトルに射影されて、スカラー値で分類される。

評価 K-NN 法と同等な結果が得て、 Naive Bayes 法よ

りも良い結果が得る。

Page 23: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 23

Linear Least-Square Regression Hyperplane

Page 24: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 24

Discriminative ClassificationSupport Vector Machines (SVM) 直感

ハイパー面が訓練ドキュメントが蜜なとことから離れたほうが良い

ハイパー面は訓練ドキュメントを通さないほうが良い 仮説

訓練ドキュメントとテストドキュメントは同じ集合から抽出する。

トピック空間は 2 個のトピックとして、 {-1,1} とエンコードする。

ハイパー面は 2 つのトピックのドキュメント空間の最も近いところから方向ベクトルを定義する。

ハイパー面は両空間の一番近いところの真ん中を交わる。

}1,1{ ic

Page 25: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 25

Support Vector Machines (SVM)

Page 26: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 26

Support Vector Machines (SVM)

ドキュメントを分類する関数を改めて定義する

まず、 α とbが次のような制約を満たす

ハイパー面の反対方向のドキュメントの距離は仮説より

従って ||α|| の値が最小になるようにハイパー面を選択

bdSVM .

1,.....n i 1b) .d(c ii

||||

2).(

||||

2)(

21

21

dd

dd

Page 27: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 27

Support Vector Machines (SVM) 実際、訓練ドキュメントはいつも完全に分かれて

いるわけではない 補足変数を導入する  (fudge variables)

相当の関数 (Lagrange Optimize)n 1,........i 0 and

n.1,....,i -1b).d(c subject to

.2

1 Minimize

i

iii

i

iC

n 1,........i C1 and

0c subject to

).(2

1 Maximize

i

ii

,ii

i

jijijiji ddcc

Page 28: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 28

Support Vector Machines (SVM)

最適関数を計算する計算量は 2 乗のオーダー 数個の λ を一度に精製する (working set) 訓練する時間は に比例し、 n~1.7-2.1 最近線形時間で計算できる 結果

SVM は他の方法と比べると、最も制度の高い分類法 研究課題

Non-linearSVM

an

Page 29: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 29

Support Vector Machines (SVM)

SVM training time variation as the training set size is increased, with and without sufficient memory to hold the training set. In the latter case, the memory is set to about a quarter of that needed by the training set.

Page 30: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 30

Support Vector Machines (SVM)

Comparison of LSVM with previous classifiers on the Reuters data set (data taken from Dumais). (The naive Bayes classier used binary features, so its accuracy can be improved)

Page 31: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 31

Support Vector Machines (SVM)

Comparison of accuracy across three classifiers: Naive Bayes, Maximum Entropy and Linear SVM, using three data sets: 20 newsgroups, the Recreation sub-tree of the Open Directory, and University Web pages from WebKB.

Page 32: SUPERVISE LEARNING Mining the Web - Chapter 5

Mining the Web Chakrabarti & Ramakrishnan 32

Support Vector Machines (SVM)

Comparison between several classifiers using the Reuters collection.