Bayesian Learning

김민재·2024년 4월 18일
0

ML

목록 보기
1/17

베이시안 러닝은 Training data를 받아 나의 belief를 업데이트 하는 방식이다.
기존에 알고 있던 방법중 하나인 Maximum likelyhood는 μ\muσ\sigma를 알지, 베이시안 러닝은 이를 모른다는것이 둘의 차이점이다.


Bayes Theroem

data D가 주어졌을때, 기존의 확률을 통해 hypothesis H를 찾는것

베이시안 러닝은 우리가 그동안 많이 봐왔던 베이즈 이론부터 시작한다.


P(hD)=P(Dh)P(h)P(D)(6.1)\begin{aligned} P(h|D) = \frac{P(D|h)P(h)}{P(D)} \tag{6.1} \end{aligned}

이제 우리가 알고싶은것은 MAP hypothesis 이다. (Maximum a posteriori)


hMAP=argmaxhH P(hD)=argmaxhHP(Dh)P(h)P(D)=argmaxhHP(Dh)P(h)(6.2)\begin{aligned} h_{MAP} &= \underset{h\in H}{\mathrm{argmax}}\ P(h|D)\\ &= \underset{h\in H}{\mathrm{argmax}}\frac{P(D|h)P(h)}{P(D)}\\ &= \underset{h\in H}{\mathrm{argmax}}P(D|h)P(h) \tag{6.2} \end{aligned}

Example. Diagnosis of Cancer

H={cancer,¬caner}D={,}\begin{aligned} &H = \left \{ \mathrm{cancer}, \mathrm{\neg caner}\right \}\\ &D = \left \{ \oplus, \ominus\right \} \end{aligned}

여기서 \oplus는 positive, \ominus는 negative이다.

\to Some known facts:

P(cancer)=0.008P(¬caner)=0.992P(cancer)=0.98P(cancer)=0.02P(¬caner)=0.03P(¬caner)=0.97\begin{aligned} P(\mathrm{cancer}) = 0.008 \qquad P(\mathrm{\neg caner}) = 0.992\\ P(\oplus|\mathrm{cancer}) = 0.98 \qquad P(\ominus|\mathrm{cancer}) = 0.02\\ P(\oplus|\mathrm{\neg caner}) = 0.03 \qquad P(\ominus|\mathrm{\neg caner}) = 0.97 \end{aligned}

then, we want to know lab test returns a "positive" result.

should we diagnose the patient as "HAVING cander" or "NOT"?

sol)

P(cancer)=P(cancer)P(cancer)=0.98×0.008=0.0078P(¬caner)=P(¬caner)P(¬caner)=0.03×0.992=0.0298\begin{aligned} P(\mathrm{cancer}|\oplus) = P(\oplus|\mathrm{cancer})P(\mathrm{cancer}) = 0.98 \times0.008 = 0.0078\\ P(\mathrm{\neg caner} | \oplus) = P(\oplus|\mathrm{\neg caner})P(\mathrm{\neg caner}) = 0.03 \times 0.992 = 0.0298 \end{aligned}

Hence,

hMAP=¬cancerh_{MAP} = \mathrm{\neg cancer}

0개의 댓글