フィッシャー基準の重みを計算する方法は?


12

パターン認識と機械学習を研究していますが、次の質問にぶつかりました。

等しい事前クラス確率P (D 1)= P (D 2)= 1の 2クラス分類問題を考えます

P(D1)=P(D2)=12

によって与えられた各クラスのインスタンスの分布

p(x|D1)=N([00],[2001]),

p(x|D2)=N([44],[1001]).

フィッシャー基準の重みを計算する方法は?

更新2:私の本が提供する計算された重量は次のとおりです W=[−43−29]。

更新3: @xeonが示唆するように、フィッシャーの判別式の予測線を決定する必要があることを理解しています。

更新4:レッツ最高のことを判別する方法の発見線形次いでフィッシャー、投影線の方向であるWは、基準関数が最大となるためです。残りの課題は、Wベクトルを数値的に取得する方法 です。WWW


最初の配布は未定義です。特に、ペアの2番目の変量は、分散が0の縮退分布を持ちますが、1番目の変量とは正の共分散を持ち、これは不可能です。
— -owensmartin

@owensmartinは、これらの値がどのように計算されるのか、考えがありますか?
— Hoshang博士15

フィッシャー基準の重みの定義は何ですか?
— ヴラディスラフドブガレス

私は、フィッシャーの線形判別が最大化するベクトルwによって与えられることを意味します... luthuli.cs.uiuc.edu/~daf/courses/Learning/Kernelpapers / ...のようなすべての資料に記載されています。2. okey @xeonですか?
— ホシャン博士15

ヒント:2つのクラスの境界はどうなりますか?線形、多項式、他に何か?
— ヴラディスラフドブガレス

回答:


11

リンクした論文(Mika et al。、1999)に従って、いわゆる一般化レイリー商を最大化するを見つけなければなりません。w

w⊤SBww⊤SWw,

ここで、平均は、共分散C 1、C 2、m1,m2C1,C2

SB=(m1−m2)(m1−m2)⊤,SW=C1+C2.

溶液を解くことにより求めることができる一般化固有値問題 最初の固有値を計算することによりλ解くことによって DET (S Bを - λ S W)= 0 、次いで固有ベクトルについて解くW。あなたのケースでは、 S B - λ S W = (16 - 3 λ 16 16 16 - 2 λ)。

SBw=λSWw,
λ
det(SB−λSW)=0
w
SB−λSW=(16−3λ161616−2λ).
行列式、この2×2行列の手で計算することができます。

最大の固有値を持つ固有ベクトルは、レイリー商を最大化します。代わりに手で計算を行うので、私が使用してPythonで一般化固有値問題を解決scipy.linalg.eigして得た あなたが本の中で見つかったソリューションとは異なります。以下に、見つけた重量ベクトルの最適な超平面(黒)と、本で見つかった重量ベクトルの超平面(赤)をプロットしました。

w1≈0.5547,w2≈0.8321,

ここに画像の説明を入力してください


1
この例は非常に興味深いものです。両方の線が2つのクラスを分けていますが、理論の観点から見ると、その1つは「より良い」ものです。
— ヴラディスラフドブガレス

2
フィッシャー基準は、books.google.com /…の
— nini

1
@Lucasは、おそらく問題の結果がxeonのコメントに近いかもしれません。
— ニニ

1
ああ !!!難しい質問です。dml.ir/ wp
— content /

1
@Lucasありがとう。W = [-2/3 -2/3]およびW = [-4/3 -2/3]およびW = [-2 -3]に別の画像を追加して、3つの異なる色で境界を確認してください。ありがとう。いい返事をして、私はあなたに賞金をかけました。
— -nini

7

SOLUTION1:

Dudaらに従って。(パターンクラシフィケーション)@lucasの代替ソリューションがあり、この場合、手作業で非常に簡単に計算できます。(この代替ソリューションが役立つことを期待してください!! :))

2クラスLDAの目的は次のとおりです。

wTSBwwTSWw

SB=(m1−m2)(m1−m2)TSW=S1+S2S1,S2m1,m2

この一般化されたローリー商の解は、一般化された固有値プローブです。

SBw=λSWw→SW−1SBw=λw

SBm1−m2w∝SW−1(m1−m2)

w

SW−1(m1−m2)=(S1+S2)−1(m1−m2)=([2001]+[1001])−1([00]−[44])=([1/3001/2])([00]−[44])=[−1.3333−2.0000]∝[0.55470.8321]

Ref: Pattern Classification by Duda, Hart, Stork

SOLUTION2:

Alternatively, it can be solved by finding eigen vector to the generalized eigen value problem. SBw=λSWw

A polynomial in lambda can be formed by determinant(SB−λSW) and the solutions to that polynomial will be the eigen value for SBw=λSWw. Now lets say you got a set of eigen values λ1,λ2,...,λn, as roots of the polynomial. Now substitute λ=λi,i∈{1,2,..,n} and get the corresponding eigen vector as solution to the linear system of equations SBwi=λiSWwi. By doing this for each i you can get a set of vectors {wi}i=1n and it is a set of eigen vectors as solutions.

determinant(SB−λSW)=[16−3λ161616−2λ]=6λ2−80λ, So eigen values are roots to polynomial 6λ2−80λ.

So λ= 0 and 40/3 are the two solutions. For LDA, eigen vector corresponding to highest eigen value is the solution.

Solution to system of equation (SB−λiSW)wi=0 and λi=40/3

which turns out to be [16−3λ161616−2λ]wi∝[−724848−32]wi=0

Solution to the above system of equation is [−0.5547−0.8321]∝[0.55470.8321] which is same as previous solution.

Alternatively, we can say that [0.55470.8321] lies in the null space of [−724848−32].

For two class LDA, eigen vector with highest eigen value is the solution. In general, for C class LDA, the first C - 1 eigen vectors to highest C - 1 eigen values constitute the solution.

This video explains how to compute eigen vectors for simple eigen value problem. ( https://www.khanacademy.org/math/linear-algebra/alternate_bases/eigen_everything/v/linear-algebra-finding-eigenvectors-and-eigenspaces-example )

Following is an example. http://www.sosmath.com/matrix/eigen2/eigen2.html

Multi-class LDA: http://en.wikipedia.org/wiki/Linear_discriminant_analysis#Multiclass_LDA

Calculating Null Space of a matrix: https://www.khanacademy.org/math/linear-algebra/vectors_and_spaces/null_column_space/v/null-space-2-calculating-the-null-space-of-a-matrix


1
Nice answer, you means answer of book is wrong!! Okey?
— Dr. Hoshang

I believe that this answer is correct and if your book defines SW and SB differently then see what you get with those definitions.
— dksahuji

2
-1.33 is equal to -4/3 but the second element is differ. Maybe book report unit vector w? Isn't right? Thanks so much
— Dr. Hoshang

2
please complete solution 2 to reach value of W to bounty it
— nini

1
@Dr.Hoshang: The solution in your book is wrong. I have no idea why.
— amoeba says Reinstate Monica
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.