#!/bin/bash

echo "Generating Delta-Robust Explanation Figures..."

########################
### CLASSIC DATASETS ###
########################

echo "  - Classic datasets evaluation..."

# Computation Time
python -m scripts.tools.evaluate_performance --data data/explanations/delta_robust/classic/inflated_explanations.csv data/explanations/delta_robust/classic/robust_explanations.csv --output-dir figures/delta_robust/classic_datasets/

# Robustness
python -m scripts.tools.evaluate_robustness --robust-data data/explanations/delta_robust/classic/robust_explanations.csv --inflated-data data/explanations/delta_robust/classic/inflated_explanations.csv --output-dir figures/delta_robust/classic_datasets/ --title "δ-robust explanations cover much of the area of inflated explanations"

###################
### SCALABILITY ###
###################

echo "  - Scalability analysis..."

# Computation Time
python -m scripts.tools.evaluate_performance --data data/explanations/delta_robust/scalability/inflated_explanations.csv data/explanations/delta_robust/scalability/robust_explanations.csv --output-dir figures/delta_robust/scalability/ --x-col-name "Number of Features"

# Robustness
python -m scripts.tools.evaluate_robustness --robust-data data/explanations/delta_robust/scalability/robust_explanations.csv --inflated-data data/explanations/delta_robust/scalability/inflated_explanations.csv --output-dir figures/delta_robust/scalability/

################
### EXAMPLES ###
################

echo "  - Example visualizations..."

# Formal Explanation
python -m scripts.tools.visualize_results --csv data/explanations/delta_robust/classic/robust_explanations.csv --dataset glass --label 5 --sample-index 3 --delta 0.09 --bounds 0.00 --plot-explanation --output figures/delta_robust/examples/robust_explanation_glass_label_5_sample_3_delta_0.00.pdf

# Inflated Explanation
python -m scripts.tools.visualize_results --csv data/explanations/delta_robust/classic/inflated_explanations.csv --dataset glass --label 5 --sample-index 3 --delta 0.09 --plot-explanation --output figures/delta_robust/examples/inflated_explanation_glass_label_5_sample_3_delta_0.09.pdf

# Robust Explanation
python -m scripts.tools.visualize_results --csv data/explanations/delta_robust/classic/robust_explanations.csv --dataset glass --label 5 --sample-index 3 --delta 0.09 --plot-explanation --output figures/delta_robust/examples/robust_explanation_glass_label_5_sample_3_delta_0.09.pdf

echo "Delta-Robust figures generation complete!"
