This project implements the first steps for using symbolic regression in hybrid system identification.
The general flow of hybrid system identification has the following five steps: This projects is composed of two algorithms which implement the steps Trace Segmentation and both Segment Grouping and Mode Characterization.
We recommend to use a virtual environment for the installation of the project. The project is tested with Python 3.12.1.
To create a virtual environment, run the following command in the project directory:
python -m venv venv
To activate the virtual environment, run the following command in the project directory:
- Linux / WSL:
source venv/bin/activate
- Windows:
.\venv\Scripts\Activate
To install the dependencies, run the following command in the project directory:
pip install -e .
To run an example, run the following command in the project directory:
python src/sr4ha/main.py --config <path_to_config_file.yaml>
The configuration files for the existing examples are stored in the config
directory.
The project is structured as follows:
- the directory
src
contains the source code of the project separated into the core parts such as the symbolic regression algorithm and the hybrid system identification algorithms and the intermediate results, further there are stopping criteria for the algorithms, experiment scripts for the segmentation and grouping part and scripts for parameter studies with optuna for selected examples. Finally, the directory contains the main script for running the complete flow - the directory
data
contains data sets for example systems stored with git lfs - the directory
results
contains the results of the experiments for the examples - the directory
config
contains the configuration files for the experiments - the directory
sr-analysis
contains scripts for minor analyses - the directory
tests
provides an (incomplete) set of unit tests for the project
The project is part of the publication "Dynamics-Based Identification of Hybrid Systems using Symbolic Regression":
@inproceedings{PSSTF2024,
author = {Swantje Plambeck and Maximilian Schmidt and Audine Subias and Louise Travé-Massuyès and Goerschwin Fey},
booktitle = {Software Engineering and Advanced Applications (SEAA)},
title = {Dynamics-Based Identification of Hybrid Systems using Symbolic Regression},
year = {2024 (in press)},
url = {https://www.tuhh.de/t3resources/es/data/publications/inPress/Learning_Hybrid_Systems_with_Symbolic_Regression-10.pdf}
}
TBD
The directory src/sr4ha/parameter-studies
contains scripts for parameter studies with optuna for selected examples. The parameter studies are conducted for the following examples:
- Converter
- Two Tank (with and without feature substitution)
Both parts of the algorithm, i.e., the segmentation and the grouping part, are evaluated. The parameter studies are conducted for the following parameters:
Symbol | Occurrence | Description |
---|---|---|
Segmentation | initial window size when learning an expression | |
Segmentation | step-width for extending the window | |
Segmentation | number of iterations of SR when learning an expression | |
Segmentation | number of iterations of SR for updating the expression on an extension | |
Segmentation | threshold for the segmentation criterion | |
Grouping | relaxation parameter for the grouping criterion | |
Grouping | number of iterations of SR when learning on grouped data | |
General | SR Parsimony coefficient (length-accuracy trade-off) for segmentation and grouping | |
General | SR Population size for segmentation and grouping |
For the parameter optimization with optuna, we define two objective functions for the segmentation and grouping part:
where