Skip to content

Commit

Permalink
Remove maq dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
erikcs committed Feb 10, 2024
1 parent 57332cb commit 9fd905a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 19 deletions.
1 change: 0 additions & 1 deletion causalml/metrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@
SensitivitySubsetData,
SensitivitySelectionBias,
) # noqa
from maq import MAQ, get_ipw_scores # noqa
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ dependencies = [
"torch",
"pyro-ppl",
"graphviz",
"maq@git+https://github.com/grf-labs/[email protected]#egg=maq&subdirectory=python-package",
]

[project.optional-dependencies]
Expand Down
17 changes: 0 additions & 17 deletions tests/test_metrics.py
Original file line number Diff line number Diff line change
@@ -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():
Expand All @@ -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)

0 comments on commit 9fd905a

Please sign in to comment.