λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°
1️⃣ AI•DS/πŸ₯Ž Casual inference

Choosing sequential testing framework - comparisons and discussions

by isdawell 2023. 3. 26.
728x90

https://engineering.atspotify.com/2023/03/choosing-sequential-testing-framework-comparisons-and-discussions/

 

Choosing Sequential Testing Framework — Comparisons and Discussions - Spotify Engineering

Choosing Sequential Testing Framework — Comparisons and Discussions - Spotify Engineering

engineering.atspotify.com

 

 

β–’ Sequential testing 

 

•  Sequential testing μ΄λž€ A/B ν…ŒμŠ€νŠΈλ₯Ό ν•˜λŠ” λ™μ•ˆ 데이터가 λ°œμƒν–ˆμ„ λ•Œ, 순차적으둜 λͺ¨λ‹ˆν„°λ§ν•¨μœΌλ‘œμ¨ μ˜μ‚¬κ²°μ •μ„ λ‚΄λ¦¬λŠ” 방법둠을 λœ»ν•œλ‹€. 

 

좜처 : μŠ€ν¬ν‹°νŒŒμ΄R&D

 

•  졜근 sequential testing 에 κ΄€ν•œ λ¬Έν—Œμ΄ μ£Όλͺ©μ„ λ°›κ³  μžˆμ§€λ§Œ, λ‹€μ–‘ν•œ sequential test 쀑 μ–΄λ–€ 것을 선택해야 할지에 κ΄€ν•œ advice λŠ” 맀우 적닀. μŠ€ν¬ν‹°νŒŒμ΄λŠ” κ²€μ • 방법을 선택할 λ•Œ μ–΄λ– ν•œ κΈ°μ€€κ³Ό λͺ©ν‘œλ‘œ 선택을 μ§„ν–‰ν•˜λŠ”μ§€ μ„€λͺ…ν•˜κ² λ‹€. 

 

 

 

 

β–’ μŠ€ν¬ν‹°νŒŒμ΄μ˜ μ‹€ν—˜ ν”Œλž«νΌ 

 

•  Group sequential test (GSTs) λ₯Ό μ‚¬μš©ν•œλ‹€. 

•  sequential analysis tool 선택에 영ν–₯을 λ―ΈμΉ  2가지 μ£Όμš” νŒŒλΌλ―Έν„° 

 

  1. If your data infrastructure provides data in batch or streaming.
  2. If you can make reasonable estimates of the maximum sample size an experiment will reach.

 

•  데이터가 batch λ‹¨μœ„λ‘œ λ“€μ–΄μ˜€λ“ , streaming λ‹¨μœ„λ‘œ λ“€μ–΄μ˜€λ“  GST λŠ” κ°€μž₯ 높은 κ²€μ •λ ₯을 μ œκ³΅ν•΄μ€€λ‹€. 

•  μŠ€ν¬ν‹°νŒŒμ΄λŠ” μƒν’ˆκ°œλ°œμˆœν™˜μ— μžˆμ–΄ 증거기반의 접근을 μ±„νƒν•œλ‹€. 

    β–Έ false positive or false negative rate → μ‹€ν—˜μ„ λ””μžμΈ ν•˜λŠ”λ° μžˆμ–΄ ν†΅μ œλ˜μ–΄μ•Ό ν•  rate 

 

 

 

 

β–’ Peeking is a common source of unintended risk inflation 

 

peeking : μ‹€ν—˜ λ˜λŠ” 연ꡬλ₯Ό μˆ˜ν–‰ν•  λ•Œ 데이터λ₯Ό μˆ˜μ§‘ν•˜λ©΄μ„œ 쀑간 κ²°κ³Όλ₯Ό ν™•μΈν•˜κ±°λ‚˜ 뢄석해 이후 데이터 μˆ˜μ§‘ λ˜λŠ” 뢄석 λ°©ν–₯성을 κ²°μ •ν•˜λŠ” 것을 peeking 이라 λΆ€λ₯Έλ‹€. μ΄λŠ” λΆ„μ„μ˜ 타당성을 κ°μ†Œμ‹œν‚€κ³  편ν–₯성을 λΆˆμ–΄μΌμœΌν‚¬ 수 있기 λ•Œλ¬Έμ—, 뢄석 μ‹œ peeking 을 μ΅œμ†Œν™” ν•˜λŠ” 것이 μ€‘μš”ν•˜λ‹€. 

•  z-tests λ˜λŠ” t-tests와 같은 λŒ€λΆ€λΆ„μ˜ ν‘œμ€€ 톡계 ν…ŒμŠ€νŠΈλŠ” 데이터 μˆ˜μ§‘ 단계가 λλ‚œ ν›„ ν…ŒμŠ€νŠΈλ₯Ό μ‚¬μš©ν•˜λŠ” κ²½μš°μ—λ§Œ μœ„ν—˜μ„ μ œν•œν•˜λŠ” λ°©μ‹μœΌλ‘œ κ΅¬μ„±λœλ‹€.

•  peeking 은 μ‹€ν—˜μ—μ„œ 잘λͺ»λœ 리슀크 관리λ₯Ό μœ λ°œν•˜λŠ” ν”ν•œ μš”μΈ 쀑 ν•˜λ‚˜μ΄λ‹€. peeking 은 데이터가 계속 μˆ˜μ§‘λ˜λŠ” λ™μ•ˆμ— z test λ‚˜ t test 와 같은 non-sequential ν•œ test κ°€ 반볡적으둜 적용될 λ•Œ, false positive λ₯Ό μœ λ°œν•œλ‹€. 

•  κ°€λ Ή, μƒˆλ‘œμš΄ pair 의 κ΄€μΈ‘μΉ˜λ₯Ό μˆ˜μ§‘ν•˜κ³ , test λ₯Ό μ§„ν–‰ν–ˆμ„ λ•Œ κ²°κ³Όκ°€ μœ μ˜ν•˜μ§€ μ•Šμ•„ λ‹€μ‹œ 또 λ‹€λ₯Έ κ΄€μΈ‘μΉ˜λ₯Ό λͺ¨μœΌκ³  test λ₯Ό μ§„ν–‰ν•˜λŠ” 과정을 λ°˜λ³΅ν•˜κ²Œ 되면 (peeking), false positive rate 이 κΈ‰κ²©νžˆ μ¦κ°€ν•œλ‹€. 

 

 

 

β–’ Sequential tests solve the peeking problem 

 

•  ν†΅μ œλ˜μ§€ μ•ŠλŠ” peeking 은 ν”Όν•΄μ•Ό ν•˜μ§€λ§Œ, μ‹€ν—˜μ„ μœ„ν•΄ 데이터λ₯Ό μˆ˜μ§‘ν•˜λŠ” λ™μ•ˆ νšŒκ·€λ₯Ό λͺ¨λ‹ˆν„°λ§ν•˜λŠ” 것도 μ€‘μš”ν•˜λ‹€. 

•  μ‹€ν—˜μ˜ μ£Ό λͺ©ν‘œλŠ” μ΅œμ’… μ‚¬μš©μžκ°€ ν…ŒμŠ€νŠΈ κ²½ν—˜μ— 뢀정적인 영ν–₯을 λ°›λŠ”μ§€ μ—¬λΆ€λ₯Ό 쑰기에 νŒŒμ•…ν•˜λŠ” 것이닀. 이λ₯Ό μœ„ν•΄μ„  false alarm 을 μΌμœΌν‚€λŠ” μœ„ν—˜ μš”μ†Œλ₯Ό ν†΅μ œν•˜λŠ” 것이 μ€‘μš”ν•˜λ‹€. μ΄λŸ¬ν•œ peeking ν˜„μƒμ„ λ°©μ§€ν•˜κΈ° μœ„ν•΄, sequential test λ₯Ό 진행할 수 μžˆλ‹€. sequential test λŠ” 데이터가 μˆ˜μ§‘λ  λ•Œ 같은 가섀검정을 반볡적으둜 ν•˜λ”λΌλ„ false positive rate 이 μ»€μ§€λŠ” 것을 방지할 수 μžˆλ‹€. 

 

 

 

β–’ μŠ€ν¬ν‹°νŒŒμ΄κ°€ μ—°κ΅¬ν•˜κ³  μ‚¬μš©ν•˜λŠ” 뢄석방법 

 

•  Group sequential test 

   β†ͺ z test 와 같은 전톡적인 κ²€μ • 방법을 μ—°μ†μ μœΌλ‘œ μ μš©ν•˜λŠ” κ²ƒμœΌλ‘œ λ³Ό 수 μžˆλ‹€. 

   β†ͺ 연속적인 μ—¬λŸ¬ 번의 검정을 μ΅œμ ν™” ν•˜κΈ° μœ„ν•΄, κ°„ν—μ μœΌλ‘œ λ°œμƒν•˜λŠ” κ²€μ • κ°„ 상관관계 ꡬ쑰λ₯Ό ν™œμš©ν•œλ‹€. 

 

 

•  Always valid inference (AVI) 

   β†ͺ μ–΄λ–€ 가섀에 λŒ€ν•΄μ„œλ„ 항상 μœ νš¨ν•œ κ²°κ³Όλ₯Ό λ„μΆœν•œλ‹€. κ²€μ • κ²°κ³Όλ₯Ό ν™•λ₯ μ μœΌλ‘œ ν•΄μ„ν•˜λŠ” 것이 μ•„λ‹ˆλΌ, μ—„λ°€ν•œ μˆ˜ν•™μ μΈ 증λͺ…을 톡해 κ²°κ³Όλ₯Ό λ„μΆœν•œλ‹€. 

 

    ∘ mixture sequential probability ratio test (mSPRT) 

    ∘ generalization of always valid inference (GAVI) 

 

 

•  corrected-alpha approach (CAA) 

   β†ͺ μ—¬λŸ¬ 개의 가섀검정을 μˆ˜ν–‰ν•  λ•Œ, 각 κ²€μ •μ˜ μœ μ˜μˆ˜μ€€μ„ λ³΄μ •ν•˜λŠ” 방법 쀑 ν•˜λ‚˜μ΄λ‹€. Bonferroni correctionκ³Ό μœ μ‚¬ν•˜μ§€λ§Œ, λ³΄μ •λœ μœ μ˜μˆ˜μ€€μ„ κ³„μ‚°ν•˜λŠ” 방법이 λ‹€λ₯΄λ‹€. μ’€ 더 μœ μ—°ν•œ 보정을 μ§„ν–‰ν•œλ‹€. 

 

 

•  Bonferroni corrections as a baseline 

   β†ͺ μ—¬λŸ¬ 가섀검정을 μˆ˜ν–‰ν•  λ•Œ κ²€μ •μ˜ μœ μ˜μ„± μˆ˜μ€€μ„ λ³΄μ •ν•˜λŠ” 방법 쀑 ν•˜λ‚˜μ΄λ‹€. 각 κ°€μ„€κ²€μ •μ˜ μœ μ˜μˆ˜μ€€μ„ μ›λž˜ 유의 μˆ˜μ€€μ—μ„œ κ°€μ„€κ²€μ •μ˜ 수 만큼 λ‚˜λˆ„μ–΄ 쀌으둜써 λ³΄μ •ν•œλ‹€. κ°€λ Ή 5개의 가섀검정을 μˆ˜ν–‰ν•˜κ³  μœ μ˜μˆ˜μ€€μ„ 0.05둜 μ„€μ •ν•œ 경우, 각 κ²€μ •μ˜ μœ μ˜μˆ˜μ€€μ„ 0.01둜 λ³΄μ •ν•œλ‹€. 이λ₯Ό 톡해 였λ₯˜λ₯Ό λ²”ν•  ν™•λ₯ μ„ κ°μ†Œμ‹œν‚¬ 수 μžˆλ‹€. κ·ΈλŸ¬λ‚˜ κ²€μ •μ˜ μˆ˜κ°€ λ§Žμ•„μ§ˆμˆ˜λ‘ μœ μ˜μˆ˜μ€€μ΄ 맀우 μž‘μ•„μ§€λŠ” λ¬Έμ œκ°€ λ°œμƒν•  수 μžˆλ‹€. 

 

 

 

β–’ 데이터가 μ–΄λ–»κ²Œ μˆ˜μ§‘λ˜λŠ”μ§€μ— 따라 κ²€μ • λ°©λ²•μ˜ 선택이 달라진닀. 

 

 

 

 

 

728x90

λŒ“κΈ€