causalml 使用介绍
1. 安装教程及官方文档
1.1 pip安装
1.2 API文档
-
https://causalml.readthedocs.io/en/latest/causalml.html
1.3 代码仓库
- github:
https://github.com/uber/causalml/
2. x-learner for multiple-treatment
2.1导包
import os
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from sklearn.linear_model import LinearRegression, LogisticRegression
from sklearn.model_selection import train_test_split
import statsmodels.api as sm
from xgboost import XGBRegressor, XGBClassifier
import warnings
from causalml.inference.meta import BaseSRegressor, BaseTRegressor, BaseXRegressor, BaseRRegressor
from causalml.inference.meta impo