A/B 測試

Statistical Thinking in Python(第 2 部分)

Justin Bois

Lecturer at the California Institute of Technology

重新設計有效嗎?

第 4 章插圖 ch4-1.002

Statistical Thinking in Python(第 2 部分)

重新設計有效嗎?

第 4 章插圖 ch4-1.003

Statistical Thinking in Python(第 2 部分)

虛無假設

  • 重新設計不影響點擊率
Statistical Thinking in Python(第 2 部分)

點擊的置換檢定

import numpy as np
# clickthrough_A, clickthrough_B: arr. of 1s and 0s

def diff_frac(data_A, data_B): frac_A = np.sum(data_A) / len(data_A) frac_B = np.sum(data_B) / len(data_B) return frac_B - frac_A
diff_frac_obs = diff_frac(clickthrough_A, clickthrough_B)
Statistical Thinking in Python(第 2 部分)

點擊的置換檢定

perm_replicates = np.empty(10000)
for i in range(10000):
     perm_replicates[i] = permutation_replicate(
                clickthrough_A, clickthrough_B, diff_frac)

p_value = np.sum(perm_replicates >= diff_frac_obs) / 10000
p_value
0.016
Statistical Thinking in Python(第 2 部分)

A/B 測試

  • 組織用來評估策略更動是否帶來更佳結果
Statistical Thinking in Python(第 2 部分)

A/B 測試的虛無假設

  • 檢定統計量不受更動影響
Statistical Thinking in Python(第 2 部分)

一起來練習吧!

Statistical Thinking in Python(第 2 部分)

Preparing Video For Download...