-
Notifications
You must be signed in to change notification settings - Fork 785
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* minimal fix to resolve #707 * lint * remove .bool() * operate on series not df --------- Co-authored-by: ras44 <rolandrmgservices@gmail.com>
- Loading branch information
1 parent
bae55f5
commit ae6c28e
Showing
2 changed files
with
32 additions
and
13 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) |