IHDP 데이터셋에 DoWhy 적용하기
가정 방문과 특수 아동 발달 센터 방문이 조산아의 건강 및 발달에 얼마나 영향을 줄까?
# importing required libraries : 필요 라이브러리 불러오기
import dowhy
from dowhy import CausalModel
import pandas as pd
import numpy as np데이터 로드
data= pd.read_csv("https://raw.githubusercontent.com/AMLab-Amsterdam/CEVAE/master/datasets/IHDP/csv/ihdp_npci_1.csv", header = None)
col = ["treatment", "y_factual", "y_cfactual", "mu0", "mu1" ,]
for i in range(1,26):
col.append("x"+str(i))
data.columns = col
data = data.astype({"treatment":'bool'}, copy=False)
data.head()treatment
y_factual
y_cfactual
mu0
mu1
x1
x2
x3
x4
x5
...
x16
x17
x18
x19
x20
x21
x22
x23
x24
x25
1. Model
2. Identify
3. Estimate (using different methods)
3.1 Using Linear Regression
3.2 Using Propensity Score Matching
3.3 Using Propensity Score Stratification
3.4 Using Propensity Score Weighting
4. Refute
4.1 random_common_cause
4.2 placebo_treatment_refuter
4.3 Data Subset Refuter
Last updated