This pull requests adds several types to utils.py that describe aspects of data saved during a gridsearch:
GridPointData: The data plotted at a single gridpoint, e.g. smoothed training data, simulations
PlotData: That data along with the experimental parameters defining the gridpoint
SeriesData: The summary data to plot after a gridsearch
Results: summary and gridpoint data, along with other parameters (e.g. metrics, gridsearch parameter values)
Data can be loaded with utils.load_results(hexstr), where hexstr is the XXXXX of the "results_XXXXXX.npy" files saved in a mitosis run. The data from multiple runs or across parameters can be combined with the following functions:
plot_experiment_across_gridpoints: Plot only the training or test data of a single experiment across multiple parameters
plot_point_across_experiments: Plot only the training or test data of multiple experiments for a single parameter set
plot_summary_metric: Combine single subplots from the summary plot (e.g. F1 score across sim_params.t_end) across multiple experiments
plot_summary_test_train: See how different parameter choices affect test/training data across multiple experiments
Because these are run after experiments, it's required to run complete gridsearch experiments before testing this stuff out. These experiments need to have plot_prefs set in order to store any intermediate plot data. The resulting files need to be opened and the hexstr extracted (since mitosis doesn't save this info in the database).
This pull requests adds several types to utils.py that describe aspects of data saved during a gridsearch:
GridPointData
: The data plotted at a single gridpoint, e.g. smoothed training data, simulationsPlotData
: That data along with the experimental parameters defining the gridpointSeriesData
: The summary data to plot after a gridsearchResults
: summary and gridpoint data, along with other parameters (e.g. metrics, gridsearch parameter values)Data can be loaded with
utils.load_results(hexstr)
, wherehexstr
is the XXXXX of the "results_XXXXXX.npy" files saved in a mitosis run. The data from multiple runs or across parameters can be combined with the following functions:plot_experiment_across_gridpoints
: Plot only the training or test data of a single experiment across multiple parametersplot_point_across_experiments
: Plot only the training or test data of multiple experiments for a single parameter setplot_summary_metric
: Combine single subplots from the summary plot (e.g. F1 score acrosssim_params.t_end
) across multiple experimentsplot_summary_test_train
: See how different parameter choices affect test/training data across multiple experimentsBecause these are run after experiments, it's required to run complete gridsearch experiments before testing this stuff out. These experiments need to have
plot_prefs
set in order to store any intermediate plot data. The resulting files need to be opened and the hexstr extracted (sincemitosis
doesn't save this info in the database).As a teaser, the functions can be called like:
Also note that I blacked some of the existing code. Sorry, I should have done that in a different PR