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

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

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 수준이라고 생각할 수 있음.

 


같이 보면 좋은 자료들

 


 

'... > 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  (0) 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
  • 전체
    오늘
    어제
    • 분류 전체보기 (740)
      • Private Life (13)
      • Programming (56)
        • DIP (104)
        • ML (26)
      • Computer (119)
        • CE (53)
        • ETC (33)
        • CUDA (3)
        • Blog, Markdown, Latex (4)
        • Linux (9)
      • ... (351)
        • Signals and Systems (103)
        • Math (172)
        • Linear Algebra (33)
        • Physics (42)
        • 인성세미나 (1)
      • 정리필요. (54)
        • 의료기기의 이해 (6)
        • PET, MRI and so on. (1)
        • PET Study 2009 (1)
        • 방사선 장해방호 (4)
        • 방사선 생물학 (3)
        • 방사선 계측 (9)
        • 기타 방사능관련 (3)
        • 고시 (9)
        • 정리 (18)
      • RI (0)
      • 원자력,방사능 관련법 (2)
  • 블로그 메뉴

    • Math
    • Programming
    • SS
    • DIP
  • 링크

    • Convex Optimization For All
  • 공지사항

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

  • 태그

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

  • 최근 글

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

티스토리툴바