To replicate the main experiments (Figures 9 and 10), run the following four files:
python3 experiments/step1_generate_data.pypython3 experiments/step2_run_algorithms.pypython3 experiments/step3_compute_metrics.pypython3 experiments/step4_plot_metrics.py
Step 1 creates synthetic data, which is saved in experiments/data/. Step 2 runs the estimators on this data and saves the results in experiments/results/. Step 3 computes the metrics reported in the paper, such as Frobenius error and BHV distance, and saves them in experiments/metrics.pkl. Step 4 handles plotting and saves the figures in experiments/figures/.
Similarly, to replicate the preliminary experiments, run the following four files:
python3 experiments/preliminary/step1_generate_data.pypython3 experiments/preliminary/step2_run_algorithms.pypython3 experiments/preliminary/step3_compute_metrics.pypython3 experiments/preliminary/step4_plot_metrics.py
src/contains an implementation of all algorithms and the data structure used for trees.experiment_utils/contains classes to manage each step of the experiments.experiments/contains scripts to run the experiments (see Replicating Experiments above)
In src/, we provide an implementation of our algorithm, shrinkage methods, and baselines.
baseline_algorithmsddgm_mle.py: Diagonally-dominant Gaussian model MLEleast_squares.py: Optimization-based algorithm to minimize Frobenius normneighbor_joining.py: The Neighbor Joining (NJ) algorithmupgma.py: The UPGMA algorithm
bmtm_mle_algorithmsolver.py: Dynamic programming algorithm introduced by the paper
shrinkageledoitwolfvalidshrink.pymxshrink.py
tree.py: Data structure for BMTMstree_utils.py: Utilities for building treesutil.py: General utility functions
data_generation/generation_manager.py: Defines theGenerationManagerclass, which is responsible for creating synthetic data. Calls ondata_generation/generators_structures.pyto generate tree structures anddata_generation/generators_parameters.pyto generate BMTM parameters.algorithm_runner.py: Defines theAlgorithmRunnerclass, which is responsible for running the algorithms on the generated data and saving the results.config_manager.py: Defines theConfigManagerclass, which is used throughout the experiments to keep track of all information.metrics_manager.py: Defines theMetricsManagerclass, which is responsible for computing the metrics that we plot.plot_manager.py: Defines thePlotManagerclass, which is responsible for plotting the results.