Experiments Module

Module that allows for quickly writing experiments.

class discopygal.experiments.Experiment_CompareFunctions(fs, experiment_args)

Class that allows running comparison experiments on two given functions. The functions should have the same signature. This also allows exporting results to various formats.

Parameters:
  • f1 (function) – list of functions

  • experiment_args (dict<str, list>) – dict that pairs experiment name with arguments to pass to each function

export_time(time_metric, path, names)

Export the times to a readable csv. User needs to supply a list of names for each function (which will be in the headers), export a table of runtimes.

run_experiment(n_times=1)

Run the experiment for n times. We store the average, max and min times as well as the last experiment result

run_function(f_idx, args)

Run self.f1 with given args. Return the runtime and the result.