From c0ca7a3b877e0207207e103fe382a5aecb3dae83 Mon Sep 17 00:00:00 2001 From: Javclaude Date: Sun, 31 May 2020 14:24:51 +0200 Subject: [PATCH] Add flat pred function --- src/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils.py b/src/utils.py index c505e58..3b71a32 100644 --- a/src/utils.py +++ b/src/utils.py @@ -21,6 +21,8 @@ from sklearn.model_selection import train_test_split from keras.utils import to_categorical +def flat_pred(preds, threshold): + return np.where(preds>threshold, 1, 0) def set_seed(seed): random.seed(seed)