After iterating through multiple nested loops to train multiple DL models, I want to poke around in the results to compare how different changes to hyperparameters, different datasets, and different model architectures performed. The data feels like a 3D array, but I want to preserve the data categories in lieu of row, column, depth indices. Currently, my approach is to use nested dictionaries. Ultimately, I would like to be able to access it similarly to a 3D array (slicing elements from any given dimension or dimensions in no particular order using colon operators). Because every category exists in every other category, I have to assume there is a more efficient way of dealing with this data than iterating through nested dicts, but that is all I have managed to come up with. What data structure (if any) would do this better?
(I am currently dealing with this in 3D, but I imagine a solution exists in N-dimensional space, so I'd be most interested in that general solution.)
If it helps, here are more specifics from my use-case: The data is from 3 different training hyperparameter sets (eg. X, Y, Z), 6 different datasets (eg. A-F), and 6 different model architectures (eg. 1-6). In gathering this data, I stored it all in dicts as follows: RESULTS = {<training style>: {<dataset_name>: {<model_arch>: ...}}}
. To access any individual result is quite easy RESULTS['Y']['A']['3']
. For that purpose, the nested dicts work fine. If I want to access all of the results for a specific style and dataset, again, that is easy: RESULTS['X']['B']
. Where I feel like they are falling flat is when I want to access all of the results for a different dimension, such as model architecture. For example, if I want to see how model 1 performed across each training style and dataset, I have to iterate through those upper-level dicts to get model 1 data from each occurrence. Sure, I could have created the dicts with model as the top-most layer, and that would solve this problem, but then what if I want to get all of the results for 'A'
.