Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
add knowledge about data type
  • Loading branch information
konstantb authored Jun 28, 2024
1 parent f8f36f5 commit e737a80
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions predictive_modeling/class_predictive_configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _dict_product(self, dicts):
return (dict(zip(dicts, x)) for x in itertools.product(*dicts.values()))


def create_predictive_configs(self):
def create_predictive_configs(self, data_object):

'''
Creates list of predictive configurations
Expand All @@ -30,12 +30,16 @@ def create_predictive_configs(self):
-------
pred_configs (list of dictionaries) : the predictive configurations
'''


data_type = data_object.data_type
pred_configs = []
for pred_name, pred_info in self.pred_algs.items():
for v in self._dict_product(pred_info):
for fs_name, fs_info in self.fs_algs.items():
for k in self._dict_product(fs_info):
pred_configs.append({"pred_name": pred_name} | v | {"fs_name": fs_name} | k)
if data_type in pred_info['data_type']:
# remove data type info from output combinations
del pred_info['data_type']
for v in self._dict_product(pred_info):
for fs_name, fs_info in self.fs_algs.items():
for k in self._dict_product(fs_info):
pred_configs.append({"pred_name": pred_name} | v | {"fs_name": fs_name} | k)

return pred_configs

0 comments on commit e737a80

Please sign in to comment.