-
Notifications
You must be signed in to change notification settings - Fork 786
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3615bc8
commit 3c0b7a6
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import pandas as pd | ||
import numpy as np | ||
import pytest | ||
from causalml.metrics.visualize import get_cumlift | ||
|
||
|
||
def test_visualize_get_cumlift_errors_on_nan(): | ||
df = pd.DataFrame( | ||
[[0, np.nan, 0.5], [1, np.nan, 0.1], [1, 1, 0.4], [0, 1, 0.3], [1, 1, 0.2]], | ||
columns=["w", "y", "pred"], | ||
) | ||
|
||
with pytest.raises(Exception): | ||
get_cumlift(df) |