[ML] Out of Bag: 유도하기.

2024. 6. 20. 08:02·.../Math
728x90
728x90

https://en.wikipedia.org/wiki/Out-of-bag_error

Out of Bag (OOB)란?

Out of Bag (OOB)는 Bagging (Bootstrap aggregating)과 같이 Bootstraping을 이용한 Ensemble Model에 등장하는 용어.

 

  • Bootstrap Sampling을 사용할 경우, 특정 predictor를 훈련시킬 때 sample point는 여러번 사용될 수 있음.
  • 이는 다른 특정 sample point는 아예 해당 predictor를 훈련시킬 때 사용되지 않음을 의미함.

확률을 계산해보면, 평균적으로 대략 36.7%의 sample point가 특정 predictor를 훈련시킬 때 사용되지 않음.

 

이들은 훈련에서 사용되지 않으므로 해당 predictor에 대한 일종의 validation set으로 사용가능함.

이같은 sample point를 가르켜 out of bag 객체라고 부름.

각각의 predictor를 훈련시킬 때의
oob들은 서로 일치하지 않는다.


유도

$m$ 개의 sample 에서 random sampling with replacement를 수행할 때, 하나의 sample을 선택할 때 특정 sample이 선택되지 않을 확률은 $1-\frac{1}{m}$ 임.

$m$ 개의 sample 을 선택하므로 결국 특정 $i^\text{th}$ sample이 선택되지 않을 확률은 다음과 같음.

$$
P_i=\left(1-\frac{1}{m}\right)^m
$$

이 확률은 $m$이 매우 커질 경우, 대략 0.367 정도가 나오는데 이는 다음의 과정을 통해 구해짐.

우선 해당 확률에 $\ln$를 취하면 다음과 같이 지수를 계수로 변경 가능함.

$$
\begin{aligned} \ln{P_i}&=\ln\left(1-\frac{1}{m}\right)^m \\ &=m \ln \left( 1-\frac{1}{m} \right) \end{aligned}
$$

$x=\frac{1}{m}$이라고 하고 $x$로 $m$을 대치하면 다음과 같은 식으로 변경됨.

$$
\begin{aligned}\ln P_i &= \frac{1}{x}\ln\left(1-x\right)\\ &=\frac{\ln (1-x)}{x}\\ \lim_{m\to\infty}\ln P_i &=\lim_{x\to 0}\frac{\ln (1-x)}{x}\end{aligned}
$$

로피탈의 정리를 이용하면,

$$
\begin{aligned} \lim_{m \to \infty} \ln P_i &= \lim_{x \to 0} \frac{\ln (1-x) }{x}\\&=\lim_{x \to 0} \frac{ \frac{d}{dx}\ln(1-x)}{\frac{d}{dx}x}\\&=\lim_{x \to 0}\frac{\frac{-1}{(1-x)}}{1}\\&=\lim_{x \to 0} \frac{-1}{1-x}\\&=-1 \\ \lim_{m \to \infty}\ln P_i &= -1\\ \therefore P_i&=e^{-1} \\ &=0.3678 \cdots\end{aligned}
$$

즉, $P_i$가 Sample의 수가 크면 0.367 정도이나 작을 경우에도 대략 0.3 정도 되기 때문에 훈련데이터의 수만큼으로 bagging을 수행할 경우, oob 는 대략 1/3 수준이라고 생각할 수 있음.

 


같이 보면 좋은 자료들

2024.06.05 - [.../Math] - [ML] Bootstrap Sampling

 

[ML] Bootstrap Sampling

Bootstrap Sampling을 이해하고 활용하기Bootstrap Sampling이란 무엇인가?Bootstrap Sampling은 통계학(Statistics)과 데이터 과학(Data Science)에서 널리 사용되는 강력한 방법론(Methodology) 중 하나임.이는 기존의 데

dsaint31.tistory.com

 

2024.09.08 - [Programming/ML] - [ML] Ensemble 기법

 

[ML] Ensemble 기법

Ensemble 이란?앙상블(Ensemble) 기법은 머신러닝에서 여러 모델을 결합하여 예측 성능을 향상시키는 방법임.앙상블의 핵심은 단일 weak learner의 한계를 극복하기 위해 여러 모델의 예측 결과를 효과

dsaint31.tistory.com


 

728x90

'... > Math' 카테고리의 다른 글

[Math] Hypothesis Testing 에서 Conservative Approach (보수적 접근법)란?  (1) 2024.07.05
[Math] Duality of Projective Geometry  (0) 2024.06.28
[Math] Ex: Lagrange Method: Tangency Condition  (0) 2024.06.19
[Math] Example of Lagrange Method  (1) 2024.06.19
[Math] Geometry (기하학) : Euclidean, Projective, Non-Euclidean  (0) 2024.06.16
'.../Math' 카테고리의 다른 글
  • [Math] Hypothesis Testing 에서 Conservative Approach (보수적 접근법)란?
  • [Math] Duality of Projective Geometry
  • [Math] Ex: Lagrange Method: Tangency Condition
  • [Math] Example of Lagrange Method
dsaint31x
dsaint31x
    반응형
    250x250
  • dsaint31x
    Dsaint31's blog
    dsaint31x
  • 전체
    오늘
    어제
    • 분류 전체보기 (787)
      • Private Life (15)
      • Programming (206)
        • DIP (116)
        • ML (35)
      • Computer (120)
        • CE (54)
        • ETC (33)
        • CUDA (3)
        • Blog, Markdown, Latex (4)
        • Linux (9)
      • ... (368)
        • Signals and Systems (115)
        • Math (176)
        • Linear Algebra (33)
        • Physics (43)
        • 인성세미나 (1)
      • 정리필요. (61)
        • 의료기기의 이해 (6)
        • PET, MRI and so on. (7)
        • PET Study 2009 (1)
        • 방사선 장해방호 (5)
        • 방사선 생물학 (3)
        • 방사선 계측 (9)
        • 기타 방사능관련 (3)
        • 고시 (9)
        • 정리 (18)
      • RI (0)
      • 원자력,방사능 관련법 (2)
  • 블로그 메뉴

    • Math
    • Programming
    • SS
    • DIP
  • 링크

    • Convex Optimization For All
  • 공지사항

    • Test
    • PET Study 2009
    • 기타 방사능관련.
  • 인기 글

  • 태그

    cv2
    fourier transform
    random
    Python
    Term
    SS
    Programming
    Vector
    signals_and_systems
    Optimization
    SIGNAL
    numpy
    math
    function
    ML
    opencv
    signal_and_system
    Probability
    linear algebra
    인허가제도
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
dsaint31x
[ML] Out of Bag: 유도하기.
상단으로

티스토리툴바