From 1742043b220925146df0658cd53156de44877e2c Mon Sep 17 00:00:00 2001 From: Sai Krishna Date: Fri, 23 Apr 2021 08:08:00 +0530 Subject: [PATCH] converters the probs into np array if its already not 'smile_imbalance()' funciton arguments does not specify that probs argument is required to be numpy array, but it does so i have added that data type in the argument letting the user know and i have also added a line 'np.array()' which is a idempotent operation(if the array passed is already numpy array then it does nothing but if its not its changes the list into numpy array) --- xai/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xai/__init__.py b/xai/__init__.py index 0312313..6fd6c2d 100644 --- a/xai/__init__.py +++ b/xai/__init__.py @@ -1035,14 +1035,14 @@ def _group_metrics( def smile_imbalance( y_test, - probs, + probs: np.ndarray, threshold=0.5, manual_review=None, display_breakdown=False, bins=10): # TODO: Change function so it only iterates once - + probs = np.array(probs) preds = convert_probs(probs, threshold).flatten() d = pd.DataFrame(probs) d.columns = ["probs"]