Skip to content

Commit 90f5c4d

Browse files
authored
Merge pull request #9 from AI-Enabled-Software-Testing/analysis-figures
Create analysis figures notebook
2 parents f8b2813 + d20784a commit 90f5c4d

11 files changed

Lines changed: 573 additions & 3 deletions

File tree

102 KB
Loading
109 KB
Loading
108 KB
Loading
149 KB
Loading
157 KB
Loading
138 KB
Loading

.gitignore

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
.venv/
22
__pycache__/
3-
.cache/
3+
**/.cache/*
4+
!.cache/experiment_figures/
5+
.cache/experiment_figures/*
6+
!.cache/experiment_figures/Models_Comparison_ga-standard/
7+
!.cache/experiment_figures/Models_Comparison_pso/
8+
!.cache/experiment_figures/Models_Comparison_rs/
9+
!.cache/experiment_figures/Optimizers_Comparison_cnn/
10+
!.cache/experiment_figures/Optimizers_Comparison_dt/
11+
!.cache/experiment_figures/Optimizers_Comparison_knn/
12+
.cache/experiment_figures/*/*
13+
!.cache/experiment_figures/Models_Comparison_ga-standard/models_comparison_ga-standard.png
14+
!.cache/experiment_figures/Models_Comparison_pso/models_comparison_pso.png
15+
!.cache/experiment_figures/Models_Comparison_rs/models_comparison_rs.png
16+
!.cache/experiment_figures/Optimizers_Comparison_cnn/all_experiments_cnn.png
17+
!.cache/experiment_figures/Optimizers_Comparison_dt/all_experiments_dt.png
18+
!.cache/experiment_figures/Optimizers_Comparison_knn/all_experiments_knn.png
419
.ruff_cache/
520
*.pyc
621
.aim/

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,31 @@ This is our [idea](./Project%20Proposal/Project%20Proposal%20-%20Fernando%20and%
1313

1414
## Models in Consideration
1515
* **Tree-based Model**: Decision Tree
16+
17+
![Comparison of Optimizers on Decision Tree](.cache/experiment_figures/Optimizers_Comparison_dt/all_experiments_dt.png)
1618
* **(Pixels) Permutation-based** (especially, neural networks): Convolutional Neural Network (CNN)
19+
20+
![Comparison of Optimizers on CNN](.cache/experiment_figures/Optimizers_Comparison_cnn/all_experiments_cnn.png)
1721
* **Kernel-based**: K-Nearest-Neighbor (KNN)
1822

23+
![Comparison of Optimizers on KNN](.cache/experiment_figures/Optimizers_Comparison_knn/all_experiments_knn.png)
24+
1925
## Metaheuristic Guided Search
2026

2127
### Baseline
2228
* **Random Search** with a fixed and reproducible base seed across runs
29+
![Comparison of Models using Random Search](.cache/experiment_figures/Models_Comparison_rs/models_comparison_rs.png)
2330

2431
### Other Algorithms
2532
* **Evolutionary Algorithm**:
2633
* Memetic Algorithm (a specialized Genetic Algorithm that escapes local search's plateau with one more tournament selection based on a `radius` parameter)
2734
* Standard Genetic Algorithm
35+
36+
![Comparison of Models using Standard Genetic Algorithm](.cache/experiment_figures/Models_Comparison_ga-standard/models_comparison_ga-standard.png)
2837
* **Swarm Optimization**: Particle Swarm Optimization
2938

39+
![Comparison of Models using Particle Swarm Optimization](.cache/experiment_figures/Models_Comparison_pso/models_comparison_pso.png)
40+
3041
## Prerequisites
3142
- Python 3.9 or higher
3243
- [uv](https://docs.astral.sh/uv/) package manager (recommended)
@@ -106,6 +117,9 @@ The script includes:
106117
### Model Training with a Customized Tuning Process
107118
* A Proof-of-Concept end-to-end quick demo is shown in the Jupyter Notebook: `notebooks\rs_training.ipynb`. It focuses primarily on using a random solver (our choice of baseline) to search for the best set of hyperparameters based on a more updated version of classes and functions interfaces from our models.
108119

120+
### Download Training Results
121+
For the time being, we've prepared a zip folder, named `experiments.bak.zip`. You can load each subfolder inside `experiment`, into your git-ignored `.cache/experiment` directory, in the format of `<model>-<optimizer name>` as the folder name, with all the run folders captured by tensorboard inside. You need to also copy the entire `final_training` folder right under `.cache/`. Then you are good to run `analyze_experiment.py` or `experiment_analysis.ipynb` to visualize results of different searches on different models.
122+
109123
### Run a Search quickly
110124
* You can run a quick hyperparameter search based on this script:
111125
```bash
@@ -157,11 +171,12 @@ python scripts/analyze_experiment.py`
157171
* Final Fitness Values Across Runs.
158172
* Run this command with tensorboard to inspect GPU usages of specific runs: `tensorboard --logdir .cache/tensorboard/[specific folder]`.
159173
* Note: this would require an extra dependency, by installing with: `pip install tensorflow`.
174+
* Final Fitness Box Plot
160175

161176
#### Analysis Specific to PSO
162177
The `scripts/analyze_experiments.py` script tries to print diagnostics of the particle swarm optimization per run with advice.
163178

164-
### Analysis Specific to GA
179+
#### Analysis Specific to GA
165180
You can also run the following script to run and visualize experiments in a scripted pipeline:
166181
```bash
167182
python scripts/analyze_ga.py
@@ -170,4 +185,13 @@ The above-mentioned script is only running 1 experiment followed by an analysis
170185
```bash
171186
python scripts/analyze_ga_parallel_run.py
172187
```
173-
They run with a single-job operation anyways (`--n-jobs = 1`).
188+
They run with a single-job operation anyways (`--n-jobs = 1`).
189+
190+
#### Specific Analysis in General
191+
A detailed analysis is shown in the Jupyter Notebook: `notebooks\experiment_analysis.ipynb`. It focuses primarily on 3 things:
192+
* **Mean Final Fitness** of Runs per model-optimizer combination
193+
* **Final Fitness Distribution** Box Plot
194+
* **Final Training** Results, in terms of composite fitness.
195+
* A **Comparison Plot** of fitnesses across optimizers under a certain model
196+
* **Convergence Plots** per model
197+
* Wilcoxon **Statistical Test** (significance level = 0.05)

experiments.bak.zip

2 MB
Binary file not shown.

0 commit comments

Comments
 (0)