Uplift Modeling (증분 효과 분석)
개요
Uplift Modeling은 마케팅 캠페인이나 처치(treatment)의 개인별 증분 효과를 추정하는 기법이다. 단순 반응률이 아닌, "처치가 없었다면 어땠을까?"를 비교하여 진정한 효과를 측정한다.
왜 필요한가?
기존 타겟팅의 한계
┌─────────────────────────────────────────────────────────────┐
│ 고객 세그먼트 │
│ │
│ ┌───────────────┐ 처치 O: 구매 80% │
│ │ Sure Things │ 처치 X: 구매 80% │
│ │ (확실한 구매)│ → 캠페인 효과: 0% (낭비!) │
│ └───────────────┘ │
│ │
│ ┌───────────────┐ 처치 O: 구매 50% │
│ │ Persuadables │ 처치 X: 구매 10% │
│ │ (설득 가능) │ → 캠페인 효과: +40% (타겟!) │
│ └───────────────┘ │
│ │
│ ┌───────────────┐ 처치 O: 구매 5% │
│ │ Lost Causes │ 처치 X: 구매 5% │
│ │ (가망 없음) │ → 캠페인 효과: 0% (낭비!) │
│ └───────────────┘ │
│ │
│ ┌───────────────┐ 처치 O: 구매 10% │
│ │ Do Not Disturb│ 처치 X: 구매 30% │
│ │ (방해 금지) │ → 캠페인 효과: -20% (역효과!) │
│ └───────────────┘ │
└─────────────────────────────────────────────────────────────┘
핵심 지표
| 지표 |
수식 |
의미 |
| CATE |
E[Y(1) - Y(0) | X] |
개인 수준 처치 효과 |
| ATE |
E[Y(1)] - E[Y(0)] |
평균 처치 효과 |
| Uplift |
P(Y=1|T=1,X) - P(Y=1|T=0,X) |
개인별 증분 반응률 |
모델링 접근법
1. Two-Model Approach (T-Learner)
┌─────────────────────────────────────────────────────────────┐
│ T-Learner │
│ │
│ Data Split: │
│ ├─ Treatment Group → Model_T (처치군 모델) │
│ └─ Control Group → Model_C (대조군 모델) │
│ │
│ Uplift 계산: │
│ uplift(x) = Model_T.predict(x) - Model_C.predict(x) │
└─────────────────────────────────────────────────────────────┘
from sklearn.ensemble import GradientBoostingClassifier
# 처치군 모델
model_t = GradientBoostingClassifier()
model_t.fit(X_treatment, y_treatment)
# 대조군 모델
model_c = GradientBoostingClassifier()
model_c.fit(X_control, y_control)
# Uplift 예측
uplift = model_t.predict_proba(X_new)[:, 1] - model_c.predict_proba(X_new)[:, 1]
| 장점 |
단점 |
| 구현 간단 |
두 모델의 오차 누적 |
| 기존 ML 모델 활용 가능 |
처치 효과 직접 학습 안함 |
2. Single-Model Approach (S-Learner)
┌─────────────────────────────────────────────────────────────┐
│ S-Learner │
│ │
│ Feature: [X, T] (처치 여부를 피처로 포함) │
│ Target: Y │
│ │
│ Uplift 계산: │
│ uplift(x) = Model.predict([x, T=1]) - Model.predict([x, T=0])│
└─────────────────────────────────────────────────────────────┘
import numpy as np
# 처치 여부를 피처에 포함
X_with_t = np.column_stack([X, treatment_flag])
model = GradientBoostingClassifier()
model.fit(X_with_t, y)
# Uplift: T=1일 때와 T=0일 때 예측 차이
X_t1 = np.column_stack([X_new, np.ones(len(X_new))])
X_t0 = np.column_stack([X_new, np.zeros(len(X_new))])
uplift = model.predict_proba(X_t1)[:, 1] - model.predict_proba(X_t0)[:, 1]
| 장점 |
단점 |
| 단일 모델 |
처치 효과 희석 가능 |
| 데이터 효율적 |
상호작용 학습 어려움 |
3. Uplift Trees / Forests
┌─────────────────────────────────────────────────────────────┐
│ Uplift Tree Split Criterion │
│ │
│ 일반 트리: Information Gain (순도 증가) │
│ Uplift 트리: Uplift Divergence (효과 차이 극대화) │
│ │
│ Split 기준: │
│ - 왼쪽 노드의 uplift vs 오른쪽 노드의 uplift │
│ - 두 그룹의 처치 효과 차이가 최대가 되는 분기점 선택 │
└─────────────────────────────────────────────────────────────┘
from causalml.inference.tree import UpliftRandomForestClassifier
model = UpliftRandomForestClassifier(
n_estimators=100,
control_name='control'
)
model.fit(X, treatment, y)
uplift = model.predict(X_new)
| 방법 |
특징 |
적합 상황 |
| S-Learner |
단일 모델, 처치를 피처로 |
데이터 적을 때 |
| T-Learner |
처치/대조 별도 모델 |
효과 이질성 클 때 |
| X-Learner |
CATE 직접 추정 |
불균형 데이터 |
| R-Learner |
잔차 기반 |
교란 변수 많을 때 |
| DR-Learner |
Doubly Robust |
안정성 중요할 때 |
평가 방법
Uplift Curve & AUUC
┌─────────────────────────────────────────────────────────────┐
│ Uplift Curve │
│ │
│ Y축: 누적 Uplift │
│ X축: 타겟팅 비율 (uplift 높은 순) │
│ │
│ │ │
│ 누적 │ ╱─── Uplift Model │
│ 효과 │ ╱ │
│ │ ╱ │
│ │─────────── Random │
│ │ │
│ └────────────────────────── │
│ 0% 50% 100% │
│ 타겟팅 비율 │
└─────────────────────────────────────────────────────────────┘
from causalml.metrics import plot_uplift_curve, auuc_score
# Uplift Curve
plot_uplift_curve(y_true, uplift_pred, treatment)
# AUUC (Area Under Uplift Curve)
score = auuc_score(y_true, uplift_pred, treatment)
Qini Coefficient
from causalml.metrics import qini_score
qini = qini_score(y_true, uplift_pred, treatment)
| 지표 |
범위 |
해석 |
| AUUC |
0~1 |
높을수록 좋음 |
| Qini |
-1~1 |
0 = 랜덤, 양수 = 효과 있음 |
실무 적용
1. 마케팅 캠페인 최적화
시나리오: 이메일 쿠폰 발송 최적화
Before (반응률 기반):
- 상위 반응률 예측 30%에게 발송
- 비용: 30만 통 × 100원 = 3,000만원
- 효과: Sure Things + Persuadables 혼재
After (Uplift 기반):
- 상위 Uplift 15%에게만 발송
- 비용: 15만 통 × 100원 = 1,500만원
- 효과: Persuadables만 타겟, ROI 2배
2. 이탈 방지
# 이탈 방지 캠페인 Uplift
segments = {
'high_uplift': uplift > 0.1, # 적극 개입
'low_uplift': abs(uplift) < 0.05, # 비용 절감
'negative_uplift': uplift < -0.05 # 접촉 금지
}
3. 가격/프로모션 최적화
할인 Uplift = P(구매 | 20% 할인) - P(구매 | 정가)
고객별로 다른 할인율 적용:
- 할인 민감 고객: 20% 할인
- 할인 무관 고객: 정가 (마진 유지)
- 할인 역효과 고객: 프리미엄 제안
구현 라이브러리
| 라이브러리 |
특징 |
| CausalML (Uber) |
가장 포괄적, 다양한 메타러너 |
| EconML (Microsoft) |
계량경제학 기반, DR-Learner |
| pylift |
경량, Uplift Tree |
| scikit-uplift |
scikit-learn 스타일 API |
체크리스트
□ 실험 설계
□ 무작위 처치/대조군 할당
□ 충분한 샘플 사이즈
□ 교란 변수 통제
□ 모델링
□ Meta-learner 선택
□ 피처 엔지니어링 (처치 상호작용)
□ 하이퍼파라미터 튜닝
□ 평가
□ Uplift Curve / AUUC
□ 세그먼트별 효과 검증
□ A/B 테스트로 실제 효과 확인
□ 운영
□ 타겟팅 임계값 설정
□ 비용-효과 분석
□ 모델 갱신 주기
참고 자료
- Künzel et al., "Metalearners for Estimating Heterogeneous Treatment Effects using Machine Learning", PNAS 2019
- CausalML Documentation (https://causalml.readthedocs.io)
- Radcliffe & Surry, "Real-World Uplift Modeling with Significance-Based Uplift Trees", KDD 2011