Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_pandas_api_continuous_cause_continuous_confounder(self, N, error_tolerance):
data = dowhy.datasets.linear_dataset(beta=10,
num_common_causes=1,
num_instruments=1,
num_samples=N,
treatment_is_binary=False)
X0 = np.random.normal(size=N)
v = np.random.normal(size=N) + X0
y = data['ate'] * v + X0 + np.random.normal()
data['df']['v'] = v
data['df']['X0'] = X0
data['df']['y'] = y
df = data['df'].copy()
variable_types = {'v': 'c', 'X0': 'c', 'y': 'c'}
outcome = 'y'
cause = 'v'
common_causes = 'X0'
def test_pandas_api_discrete_cause_discrete_confounder(self, N, error_tolerance):
data = dowhy.datasets.linear_dataset(beta=10,
num_common_causes=1,
num_instruments=1,
num_samples=N,
treatment_is_binary=False)
X0 = np.random.normal(size=N).astype(int)
v = (np.random.normal(size=N) + X0).astype(int)
y = data['ate'] * v + X0 + np.random.normal()
data['df']['v'] = v
data['df']['X0'] = X0
data['df']['y'] = y
df = data['df'].copy()
variable_types = {'v': 'd', 'X0': 'd', 'y': 'c'}
outcome = 'y'
cause = 'v'
common_causes = 'X0'