SlideShare a Scribd company logo
1 of 23
머신러닝과 데이터마이닝의 차이점?
- ML : 데이터를 통한 학습 후 결과 예측
(지도, 비지도, 강화학습 등 Computer science 중심)
- DM : 데이터에서 패턴, 상관성 등을 발견
(연관, 회귀, 분류 등 Statistics 중심)
각 예시?
KOOC study , Ch1. Motivations and Baiscs
Machine Learning?
x와 y 관계를 잘 설명하는 Function / Hypothesis 를 찾는 방법론
-> X, Y 를 잘 설명하는 최적화 된 parameter를 찾는 과정
KOOC study , Ch1. Motivations and Baiscs
Optimization methods
1) MLE : Maximum Likelihood Estimation
2) MAP : Maximum Posterior Estimation
3) LSE : Least Square Estimation
+ Gradient Descent vs Newton’s method
KOOC study , Ch1. Motivations and Baiscs
KOOC study , Ch1. Motivations and Baiscs
Probablity
: Probability dist (fixed)에서 관측값/구간이 얼마의 확률로 존재하는가
확률 = P(관측값 | 확률분포) = P( D | Θ )
KOOC study , Ch1. Motivations and Baiscs
Discrete Continuous
4가 나올 확률
P(x=4) = 1/6
4가 나올 확률
P(x=4) = 0
P(2<=x<=4) = 0.4
KOOC study , Ch1. Motivations and Baiscs
Likelihood
: 어떤 값이 관측됐을 때 어떤 확률 분포에서 왔을 지에 대한 확률
Likelihood = L(확률분포 | 관측값) = L ( Θ | D )
KOOC study , Ch1. Motivations and Baiscs
Likelihood
: 어떤 값이 관측됐을 때 어떤 확률 분포에서 왔을 지에 대한 확률
Likelihood = L(확률분포 | 관측값) = L ( Θ | D )
Probablity
: Probability dist (fixed)에서 관측값/구간이 얼마의 확률로 존재하는가
확률 = P(관측값 | 확률분포) = P( D | Θ )
KOOC study , Ch1. Motivations and Baiscs
Ex. Discrete Case , 압정 던지기, 앞면(H)가 나올 확률(Θ)
- 5회(n) 시행 , 3번 앞면이 나왔다. P=Θ
- 확률분포 Binomial Dist 를 이용,
압정던지기 사건 ~ Bin(n, Θ) , iid 가정
1) MLE (Maximum Likelihood Estimation)
어떤 데이터(D)가 관측될 확률을 최대화 하는 모수(Θ)를 추론하는 방법
1) MLE
Simple Error Bound
5회 수행 vs 50회 수행 차이? -> 오차범위 감소
KOOC study , Ch1. Motivations and Baiscs
KOOC study , Ch1. Motivations and Baiscs
1) MLE
어떤 데이터(D)가 관측될 확률을 최대화 하는 모수(Θ)를 추론하는 방법
모수 = 모든 가능도의 곱
Ex. Continuous Case , 나의 실제 키 구하기
- 5회(n) 시행 , 178, 179, 180, 181, 182 관측
- 확률분포 Normal Dist, iid, sigma^2 = 1 을 가정
Normal dist pdf :
L(D|u) = (u-178)^2 + ~ + (u-180)^2 + ~ + (u-182)^2
argmaxL(D|u) 계산 시 u_hat = 180
2) MAP (Maximum a Posteriori Estimation)
MLE = P(D|Θ) 는 극단적인 obs에 부적절
ex. 주사위 5회 시행 , 6 만 나온 경우 -> 6이 나올 확률 100%
MLE를 general하게 parameter estimation 할 수 없을까?
MAP (with Bayes) =
P(Θ) = 사전확률은 0~1 범위를 가지는 Beta dist로 가정
KOOC study , Ch1. Motivations and Baiscs
2) MAP (Maximum a Posteriori Estimation)
KOOC study , Ch1. Motivations and Baiscs
- Prior로 exponential 형태 dist 주로 사용
: likelihood와 별개로 prior = posterior가 exponential family로 유
사한 형태 가짐 (ex. Beta = Beta)
- Piror , Posterior 관련 정리 페이지
https://en.wikipedia.org/wiki/Conjugate_prior
2) MAP (Maximum a Posteriori Estimation)
KOOC study , Ch1. Motivations and Baiscs
Likelihood Maximize Posterior Maximize
3) LSE (Least Square Estimation)
KOOC study , Ch1. Motivations and Baiscs
실제값 – 결과값 오차제곱합이 최소가 되는 parameter를 구하는 방법
Ex. 단순선형회귀모형을 가정
단점 : Outlier까지 최적화 하려함
+ Gradient Descent vs Newton’s method
KOOC study , Ch1. Motivations and Baiscs
실제는 함수가 Quadratic function이 아닌 경우가 대다수
-> cost function = Convex 일 때
Probability
KOOC study , Ch1. Motivations and Baiscs
Conditional Probability
KOOC study , Ch1. Motivations and Baiscs
Probability Distribution
KOOC study , Ch1. Motivations and Baiscs
A Function mapping an event to a probability
KOOC study , Ch1. Motivations and Baiscs
- 대수의 법칙
KOOC study , Ch1. Motivations and Baiscs
표본의 수가 커지면 표본평균이 모평균에 수렴한다
Proof.
- 중심극한정리
KOOC study , Ch1. Motivations and Baiscs
표본의 수가 커지면 표본평균의 분포는 정규분포에 가까워진다
(모집단의 분포에 관계없이)
Proof.
1) 적률생성함수
2) 테일러급수 이용
궁금하시면 https://freshrimpsushi.tistory.com/43 참고하세요
Reference
https://blog.cloudera.com/blog/2015/12/common-probability-distributions-the-data-scientists-crib-sheet/
https://niceguy1575.tistory.com/87
https://dermabae.tistory.com/188
https://jjangjjong.tistory.com/41
http://rstudio-pubs-static.s3.amazonaws.com/204928_c2d6c62565b74a4987e935f756badfba.html
http://sanghyukchun.github.io/58/

More Related Content

More from suman_lim

KOOC Ch8. k-means & GMM
KOOC Ch8. k-means & GMMKOOC Ch8. k-means & GMM
KOOC Ch8. k-means & GMMsuman_lim
 
Model interpretation
Model interpretationModel interpretation
Model interpretationsuman_lim
 
tsfresh_suman2
tsfresh_suman2tsfresh_suman2
tsfresh_suman2suman_lim
 
Lightgbm_suman
Lightgbm_sumanLightgbm_suman
Lightgbm_sumansuman_lim
 
Boosting_suman
Boosting_sumanBoosting_suman
Boosting_sumansuman_lim
 

More from suman_lim (6)

KOOC Ch8. k-means & GMM
KOOC Ch8. k-means & GMMKOOC Ch8. k-means & GMM
KOOC Ch8. k-means & GMM
 
Shap
ShapShap
Shap
 
Model interpretation
Model interpretationModel interpretation
Model interpretation
 
tsfresh_suman2
tsfresh_suman2tsfresh_suman2
tsfresh_suman2
 
Lightgbm_suman
Lightgbm_sumanLightgbm_suman
Lightgbm_suman
 
Boosting_suman
Boosting_sumanBoosting_suman
Boosting_suman
 

Kooc ch1 _suman

  • 1. 머신러닝과 데이터마이닝의 차이점? - ML : 데이터를 통한 학습 후 결과 예측 (지도, 비지도, 강화학습 등 Computer science 중심) - DM : 데이터에서 패턴, 상관성 등을 발견 (연관, 회귀, 분류 등 Statistics 중심) 각 예시? KOOC study , Ch1. Motivations and Baiscs
  • 2. Machine Learning? x와 y 관계를 잘 설명하는 Function / Hypothesis 를 찾는 방법론 -> X, Y 를 잘 설명하는 최적화 된 parameter를 찾는 과정 KOOC study , Ch1. Motivations and Baiscs
  • 3. Optimization methods 1) MLE : Maximum Likelihood Estimation 2) MAP : Maximum Posterior Estimation 3) LSE : Least Square Estimation + Gradient Descent vs Newton’s method KOOC study , Ch1. Motivations and Baiscs
  • 4. KOOC study , Ch1. Motivations and Baiscs
  • 5. Probablity : Probability dist (fixed)에서 관측값/구간이 얼마의 확률로 존재하는가 확률 = P(관측값 | 확률분포) = P( D | Θ ) KOOC study , Ch1. Motivations and Baiscs Discrete Continuous 4가 나올 확률 P(x=4) = 1/6 4가 나올 확률 P(x=4) = 0 P(2<=x<=4) = 0.4
  • 6. KOOC study , Ch1. Motivations and Baiscs Likelihood : 어떤 값이 관측됐을 때 어떤 확률 분포에서 왔을 지에 대한 확률 Likelihood = L(확률분포 | 관측값) = L ( Θ | D )
  • 7. KOOC study , Ch1. Motivations and Baiscs Likelihood : 어떤 값이 관측됐을 때 어떤 확률 분포에서 왔을 지에 대한 확률 Likelihood = L(확률분포 | 관측값) = L ( Θ | D ) Probablity : Probability dist (fixed)에서 관측값/구간이 얼마의 확률로 존재하는가 확률 = P(관측값 | 확률분포) = P( D | Θ )
  • 8. KOOC study , Ch1. Motivations and Baiscs Ex. Discrete Case , 압정 던지기, 앞면(H)가 나올 확률(Θ) - 5회(n) 시행 , 3번 앞면이 나왔다. P=Θ - 확률분포 Binomial Dist 를 이용, 압정던지기 사건 ~ Bin(n, Θ) , iid 가정 1) MLE (Maximum Likelihood Estimation) 어떤 데이터(D)가 관측될 확률을 최대화 하는 모수(Θ)를 추론하는 방법
  • 9.
  • 10. 1) MLE Simple Error Bound 5회 수행 vs 50회 수행 차이? -> 오차범위 감소 KOOC study , Ch1. Motivations and Baiscs
  • 11. KOOC study , Ch1. Motivations and Baiscs 1) MLE 어떤 데이터(D)가 관측될 확률을 최대화 하는 모수(Θ)를 추론하는 방법 모수 = 모든 가능도의 곱 Ex. Continuous Case , 나의 실제 키 구하기 - 5회(n) 시행 , 178, 179, 180, 181, 182 관측 - 확률분포 Normal Dist, iid, sigma^2 = 1 을 가정 Normal dist pdf : L(D|u) = (u-178)^2 + ~ + (u-180)^2 + ~ + (u-182)^2 argmaxL(D|u) 계산 시 u_hat = 180
  • 12. 2) MAP (Maximum a Posteriori Estimation) MLE = P(D|Θ) 는 극단적인 obs에 부적절 ex. 주사위 5회 시행 , 6 만 나온 경우 -> 6이 나올 확률 100% MLE를 general하게 parameter estimation 할 수 없을까? MAP (with Bayes) = P(Θ) = 사전확률은 0~1 범위를 가지는 Beta dist로 가정 KOOC study , Ch1. Motivations and Baiscs
  • 13. 2) MAP (Maximum a Posteriori Estimation) KOOC study , Ch1. Motivations and Baiscs - Prior로 exponential 형태 dist 주로 사용 : likelihood와 별개로 prior = posterior가 exponential family로 유 사한 형태 가짐 (ex. Beta = Beta) - Piror , Posterior 관련 정리 페이지 https://en.wikipedia.org/wiki/Conjugate_prior
  • 14. 2) MAP (Maximum a Posteriori Estimation) KOOC study , Ch1. Motivations and Baiscs Likelihood Maximize Posterior Maximize
  • 15. 3) LSE (Least Square Estimation) KOOC study , Ch1. Motivations and Baiscs 실제값 – 결과값 오차제곱합이 최소가 되는 parameter를 구하는 방법 Ex. 단순선형회귀모형을 가정 단점 : Outlier까지 최적화 하려함
  • 16. + Gradient Descent vs Newton’s method KOOC study , Ch1. Motivations and Baiscs 실제는 함수가 Quadratic function이 아닌 경우가 대다수 -> cost function = Convex 일 때
  • 17. Probability KOOC study , Ch1. Motivations and Baiscs
  • 18. Conditional Probability KOOC study , Ch1. Motivations and Baiscs
  • 19. Probability Distribution KOOC study , Ch1. Motivations and Baiscs A Function mapping an event to a probability
  • 20. KOOC study , Ch1. Motivations and Baiscs
  • 21. - 대수의 법칙 KOOC study , Ch1. Motivations and Baiscs 표본의 수가 커지면 표본평균이 모평균에 수렴한다 Proof.
  • 22. - 중심극한정리 KOOC study , Ch1. Motivations and Baiscs 표본의 수가 커지면 표본평균의 분포는 정규분포에 가까워진다 (모집단의 분포에 관계없이) Proof. 1) 적률생성함수 2) 테일러급수 이용 궁금하시면 https://freshrimpsushi.tistory.com/43 참고하세요

Editor's Notes

  1. Uniform 일 경우 MAP = MLE
  2. Uniform 일 경우 MAP = MLE