acceptance criteria fix

This commit is contained in:
Steve Nyemba 2020-03-06 15:26:18 -06:00
parent 49177957b8
commit e02a4a60ab
1 changed files with 4 additions and 2 deletions

View File

@ -584,7 +584,7 @@ class Predict(GNet):
p = 0 not in df.sum(axis=1).values p = 0 not in df.sum(axis=1).values
x = df.sum(axis=1).values x = df.sum(axis=1).values
if np.divide( np.sum(x), x.size) > .9 or p and np.sum(x) == x.size: if x.max() == 1 and np.divide( np.sum(x), x.size) > .9 or p and np.sum(x) == x.size and x.size == self.values.size:
ratio.append(np.divide( np.sum(x), x.size)) ratio.append(np.divide( np.sum(x), x.size))
found.append(df) found.append(df)
if i == CANDIDATE_COUNT: if i == CANDIDATE_COUNT:
@ -606,7 +606,9 @@ class Predict(GNet):
# r = np.zeros((self.ROW_COUNT,len(columns))) # r = np.zeros((self.ROW_COUNT,len(columns)))
# r = np.zeros(self.ROW_COUNT) # r = np.zeros(self.ROW_COUNT)
if self.logger :
info = {"found":len(found),"selected":INDEX, "ratio": ratio[INDEX],"rows":df.shape[0],"cols":df.shape[1]}
self.logger.write({"module":"gan-generate","action":"generate","input":info})
df.columns = self.values df.columns = self.values
if len(found): if len(found):
# print (len(found),NTH_VALID_CANDIDATE) # print (len(found),NTH_VALID_CANDIDATE)