bug fix: preconditions

This commit is contained in:
Steve Nyemba 2022-04-12 14:59:46 -05:00
parent bbbeb5172a
commit 9b3031af1c
1 changed files with 11 additions and 1 deletions

View File

@ -248,7 +248,7 @@ class Learner(Process):
_args = {"schema":self.get_schema(),"data":self._df,"columns":columns} _args = {"schema":self.get_schema(),"data":self._df,"columns":columns}
if self._map : if self._map :
_args['map'] = self._map _args['map'] = self._map
self._encoder = prepare.Input(**_args) self._encoder = prepare.Input(**_args) if self._df.shape[0] > 0 else None
class Trainer(Learner): class Trainer(Learner):
""" """
This will perform training using a GAN This will perform training using a GAN
@ -263,6 +263,10 @@ class Trainer(Learner):
self.candidates = int(_args['candidates']) if 'candidates' in _args else 1 self.candidates = int(_args['candidates']) if 'candidates' in _args else 1
def run(self): def run(self):
self.initalize() self.initalize()
if self._encoder is None :
#
# @TODO Log that the dataset was empty or not statistically relevant
return
_space,_matrix = self._encoder.convert() _space,_matrix = self._encoder.convert()
_args = self.network_args _args = self.network_args
@ -311,9 +315,15 @@ class Generator (Learner):
file.close() file.close()
def run(self): def run(self):
self.initalize() self.initalize()
if self._encoder is None :
#
# @TODO Log that the dataset was empty or not statistically relevant
return
# #
# The values will be returned because we have provided _map information from the constructor # The values will be returned because we have provided _map information from the constructor
# #
values,_matrix = self._encoder.convert() values,_matrix = self._encoder.convert()
_args = self.network_args _args = self.network_args
_args['map'] = self._map _args['map'] = self._map