From 9fd905a5881b37043bad9a6af61c26524eb1a0bf Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 9 Feb 2024 22:18:20 -0800 Subject: [PATCH] Remove maq dependency --- causalml/metrics/__init__.py | 1 - pyproject.toml | 1 - tests/test_metrics.py | 17 ----------------- 3 files changed, 19 deletions(-) diff --git a/causalml/metrics/__init__.py b/causalml/metrics/__init__.py index 2986680b..0bc9d187 100644 --- a/causalml/metrics/__init__.py +++ b/causalml/metrics/__init__.py @@ -32,4 +32,3 @@ SensitivitySubsetData, SensitivitySelectionBias, ) # noqa -from maq import MAQ, get_ipw_scores # noqa diff --git a/pyproject.toml b/pyproject.toml index 48e0bc69..de517a31 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,6 @@ dependencies = [ "torch", "pyro-ppl", "graphviz", - "maq@git+https://github.com/grf-labs/maq.git@py0.2.2#egg=maq&subdirectory=python-package", ] [project.optional-dependencies] diff --git a/tests/test_metrics.py b/tests/test_metrics.py index 8eb5c3d6..7448c491 100644 --- a/tests/test_metrics.py +++ b/tests/test_metrics.py @@ -1,8 +1,6 @@ import pandas as pd -import numpy as np from numpy import isclose from causalml.metrics.visualize import qini_score -from causalml.metrics import MAQ, get_ipw_scores def test_qini_score(): @@ -28,18 +26,3 @@ def test_qini_score(): # for each learner, its qini score should stay same no matter calling with another model or calling separately assert isclose(full_result["learner_1"], learner_1_result["learner_1"]) assert isclose(full_result["learner_2"], learner_2_result["learner_2"]) - - -def test_MAQ(): - np.random.seed(42) - n = 1000 - K = 5 - tau_hat = np.random.randn(n, K) - cost = np.random.rand(n, K) - DR_scores = np.random.randn(n, K) - - mq = MAQ(n_bootstrap=200) - mq.fit(tau_hat, cost, DR_scores) - - # (0.005729002695991717, 0.019814651108894354) - assert isclose(mq.average_gain(spend=0.1)[0], 0.005729)