728x90

https://machinelearningmastery.com/bayes-optimal-classifier/#:~:text=The%20Bayes%20Optimal%20Classifier%20is,prediction%20for%20a%20new%20example.&text=Bayes%20Optimal%20Classifier%20is%20a%20probabilistic%20model%20that%20finds%20the,for%20a%20new%20data%20instance.

 

A Gentle Introduction to the Bayes Optimal Classifier

The Bayes Optimal Classifier is a probabilistic model that makes the most probable prediction for a new example. It is described using the Bayes Theorem that provides a principled way for calculating a conditional probability. It is also closely related to

machinelearningmastery.com

Bayes optimal classifier는 새로운 example에 대해서 가장 확률적으로 그럴 듯환 prediction을 결과를 도출하는 확률 모델이다.

이는 Bayes Theorem을 기반으로 하며, MAP로 가장 확률적으로 그럴듯한 결론을 도출한다.

 

Bayes Optimal Classifier는 실제로 계산하기에는 너무나 복잡하다. 그러나 Gibbs algorithm 및 Naive Bayes로 approximation하여 결과를 도출한다.

 

 

Maximum a Posteriori (MAP)

Meachine learning에서 traing data를 가장 잘 설명하는 모델을 찾는 것이 목적이다.

 

이때 기반으로 사용되는 확률 이론이 크게 2가지가 있다.

 

 

  • Maximum a Posteriori (MAP), a Bayesian method.
  • Maximum Likelihood Estimation (MLE), a frequentist method.

이 이론을 이용하여 다음과 같은 질문에 대답할 수 있다.

 

 

What is the most probable hypothesis given the training data?

 

이때, Bayesian method로 접근 할 경우, 다음과 같이 X(data)가 주어졌을 때,

P(parameter)의 확률을 다음과 같이 표현할 수 있다.


P(theta | X) = P(X | theta) * P(theta)

 

이러한 테크닉을 

maximum a posteriori estimation,” or MAP estimation for short, and sometimes simply “maximum posterior estimation.”

이라고 보통 부른다.

 

결론적으로는

 

maximize P(X | theta) * P(theta)

 

를 하는 parameter를 찾는 것이 목적이 된다.

 

Bayes Optimal Classifier

 

Bayes optimal Classifier는 다음과 같은 질문에 해답을 주는 classifier다.

 

What is the most probable classification of the new instance given the training data?

 

그리고 다음과 같은 이름으로 불린다.

 

The Bayes optimal learner, the Bayes classifier, Bayes optimal decision boundary, or the Bayes optimal discriminant function.

 

일반적으로 가장 확률적으로 그럴듯한 new instance의 classification 결과는 모든 hypotheses의 prediction을 그들의 posterior porbabilities의 weighted sum으로 결정된다.

 

이를 수식으로 표현하면 다음과 같다.

 

P(vj | D) = sum {h in H} P(vj | hi) * P(hi | D)

 

vj is a new instance to be classified,

H is the set of hypotheses for classifying the instance,

hi is a given hypothesis, 

P(vj | hi) is the posterior probability for vi given hypothesis hi,

P(hi | D) is the posterior probability of the hypothesis hi given the data D.

 

이때, 결과는 다음과 같이 결정한다.

 

max sum {h in H} P(vj | hi) * P(hi | D)

 

이 수식을 통해 example을 classify 하는 모델을 Bayes optimal classifier라고 하며,같은 hypothesis space와 같은 prior knowledge를 사용하는 경우, 다른 어떤 classification method도 이 성능을 넘지 못한다.

 

이 말 뜻은 같은 data, 같은 hypotheses, 같은 prior probabilities를 이용하는 경우 어떤 알고리즘도 이 방법의 성능을 넘지 못한다는 것이고, 그래서 optimal classifier.” 라고 부른다.

 

비록 이 classifier는 optimal한 prediction을 하지만, 완벽한 classifier는 아니다. training data의 uncertatiny 및 problem domain과 hypothesis을 모든 경우에 고려할 수는 없기 때문이다.

 

그래서 이러한 optimal classifier도 error를 가지며, 이를 Bayes error라고 한다.

 

즉, Bayes Optimal Classifier는 lowest possible test error rate를 가지며, 이를 bayes error rate라고 부른다. 

이는 더이상 줄일 수 없는(irreducible) error와 같다.

 

Bayes Error: The minimum possible error that can be made when making predictions.

 

 

 

 

 

 

 

728x90

'Dic' 카테고리의 다른 글

End-to-end learning  (0) 2021.01.11
Sampling with replacement  (0) 2021.01.07
Gaussian mixture model  (0) 2021.01.01
Focal Loss  (0) 2020.12.30
imagenet pretrained model에서 imagenet data 분포로 normalize하는 이유  (0) 2020.12.30

+ Recent posts