From a51be50a862ef3c93436f667dd13d133644671ac Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Wed, 26 Feb 2020 09:25:13 -0600 Subject: [PATCH] bug fix: missing values when generated --- data/gan.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/gan.py b/data/gan.py index d1b3123..204f8af 100644 --- a/data/gan.py +++ b/data/gan.py @@ -594,6 +594,7 @@ class Predict(GNet): # # In case we are dealing with actual values like diagnosis codes we can perform # + INDEX = np.random.choice(np.arange(len(found)),1)[0] INDEX = ratio.index(np.max(ratio)) df = found[INDEX] @@ -609,7 +610,9 @@ class Predict(GNet): # let's get the missing rows (if any) ... # ii = df.apply(lambda row: np.sum(row) == 0 ,axis=1) - if ii.shape[0] == 0 : + # print ([' **** ',ii.sum()]) + + if ii.shape[0] > 0 : # #@TODO Have this be a configurable variable missing = np.repeat(0, np.where(ii==1)[0].size)