Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 3.01 KB

Collecting, Extracting, and Interpreting Optimization Results using Python and MATLAB.md

File metadata and controls

43 lines (28 loc) · 3.01 KB

Visualizing the Pareto Front of a Multi-Objective Optimization Process

This tutorial will guide you through the process of collecting, extracting, and interpreting the results of the optimization process. The results are represented as a Pareto front in a three-dimensional space. Each dimension corresponds to one of three readability metrics under investigation.

Step 1: Understand the Database Structure

The optimization results and relevant metadata are stored in the database. This includes information about the reward function (how readability is calculated), the optimization algorithm used, the name of the graph file, etc. The database also contains the parameters, readability metrics, weights, and iteration details of the optimization process. Each weighting scheme is stored in its own database (.db) file. For example, if you are optimizing against three different readability metrics, there will be 15 different database files for 15 possible combinations of weighting schemes.

Step 2: Convert Database Files for MATLAB

Execute the make_mat.py Python script. This script converts the database files into a MATLAB compatible format (.mat).

NOTE: when you do this, make sure all the db files are under the readability_optimization/database folder

Step 3: Visualize the Results with MATLAB

NOTE: this step requires MATLAB to be installed on your machine. If you don't have access to MATLAB, you can use the Python Streamlit app to visualize the results. See the next section the Python Streamlit alternative.

Open the visulization/visualize_3_objective_optimization.m MATLAB script. Ensure that the .mat file loaded at the top of the script corresponds to the .mat file you just generated. Running this script will generate an interactive 3D visualization of the resulting Pareto front.

You can interact with this visualization in several ways:

  • Point information: Clicking on a point/dot in the visualization will open an panel displaying the readability scores that correspond to the layout and layout parameters used to generate the selected solution.

  • Color by generation: The 'color by generation' option colors each point by its relative "age"; that is, how early or late it was tested during the optimization process. For example, layouts tested towards the end of the optimization will be shown in red, while those tested earlier will appear in blue. This visualization option would assist you in understanding how the optimizer traverses the Pareto front.

Step 4: Visualize the Results with Python Streamlit

Alternatively, you can use streamlit to open a web app contains the optimized layout and the readability space visualization. To do so first move all the layout images generated by the optimizer to the visulization folder. i.e. all images starting with optimized_ should be moved under the visulization folder. Then run the following command to start the streamlit app.

streamlit run visulization/streamlit+visulize_3_objective_optimization.py