Post-Hoc Analysis

​🚀 The Retro-Analysis Module

Sometimes we might want to rerun analysis after a Session, Trial or Experiment has completed. For instance, we added new derived metrics or new ways to plotting the graphs. This quick tutorial will show us a command to do so.

Since all the analysis data are generated by the analysis module, we can simply rerun it on the Session, Trial or Experiment. This is handled by the retro_analysis module.

Let's supposes our data is saved to data/ppo_lunar_2019_11_30_002958 and we wish to run retro_analysis on it. Use the following command:

python -c 'import sys; from slm_lab.experiment import retro_analysis; retro_analysis.retro_analyze("data/ppo_lunar_2019_11_30_002958")'

When invoked, the retro_analysis module will load the data saved at the end of Session, Trial and Experiment, then call the analysis module methods on them. When completed, the new derived data files will overwrite their older counterparts.

The retro_analysis module is safe and free from side-effects – it only overwrites data that is derived, so there is no risk of destroying the data that needs a full rerun to recollect.