dict_util

aitoolbox.utils.dict_util.combine_prediction_metadata_batches(metadata_list)[source]
Combines a list of dicts with the same keys and lists as values into a single dict with concatenated lists

for each corresponding key

Parameters

metadata_list (list) – list of dicts with matching keys and lists for values

Returns

combined single dict

Return type

dict

aitoolbox.utils.dict_util.flatten_dict(nested_dict, parent_key='', sep='_')[source]

Flatten the nested dict of dicts of …

Parameters
  • nested_dict (dict) – input dict

  • parent_key (str) –

  • sep (str) – separator when flattening the category

Returns

flattened dict

Return type

dict

aitoolbox.utils.dict_util.combine_dict_elements(list_of_dicts)[source]

Combine into single list the elements with the same key across several dicts

Parameters

list_of_dicts (list) – list of dicts with matching keys

Returns

combined single dict

Return type

dict

aitoolbox.utils.dict_util.flatten_combine_dict(train_history)[source]

Flatten all dict of dicts and combine elements with the same key into a single list in the dict

Parameters

train_history (dict) –

Returns

Return type

dict