/sysidentpygui

GUI for System Identification using NARX and NARMAX models

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Streamlit App Repo

What is SysIdentPyGUI?

SysIdentPyGUI is a webapp for the Python module SysIdentPy. SysIdentPy is an open-source Python module for System Identification using NARMAX models built on top of numpy. SysIdentPy provides an easy-to-use and flexible framework for building Dynamical Nonlinear Models for time series and dynamic systems.

Get more information on our About page and in SysIdentPy's Documentation and its GitHub repository.

How can I use SysIdentPyGUI?

SysIdentPyGUI is currently hosted on Streamlit Cloud. You can run it locally on your machine via a containerized version through Docker by using the Dockerfile that is available, through the following commands:

docker build -t sysidenpygui .

The above command will build the Docker Image. Check the image by typing:

docker images

The sysidentpygui image should appear in the images list. Run the container with:

docker run -p 8501:8501 sysidentpygui

Alternatively, you can run the Streamlit application locally using:

streamlit run 1_🔎_SysIdentPyGUI.py

Requirements for local use

SysIdentPyGUI requires the following modules for a local host:

  • Python (>= 3.10)
  • Sysidentpy (== 0.3.1)
  • Streamlit (>= 1.14.0)
  • Matplotlib (>= 3.6.1)
  • Numpy (>= 1.23.4)
  • Pandas (>= 1.5.1)
  • Pillow (>= 9.4.0)

Use pip to install the dependecies throught the requirements.txt file. If you choose to run the containerized version, the Dockerfile will install de dependencies for you.

Which features from SysIdentPy are available on SysIdentPyGUI?

  • Model identification using AOLS, ER, MetaMSS and FROLS
  • Download your model
  • Load and validate your model
  • Simulate a predefined model

Basic usage examples

To replicate the following examples, you can download the data available here.

Model ID

First upload your data and set the percentage of data that will be used as validation data.

Then, go to the 'Model Setup' tab and make your desired changes to the model configuration. At the bottom of the page, you can make changes to the way that SysIdentPy will run the predict if wanted.

For MISO data, you can define the lags for each specific input separately.

You can then proceed to the 'Model Validation and Metrics' tab, to check the model regressors, results and residues plots, as well as the metrics.

Model download

Go to the 'Save Model' tab to save your final model.

Load Model

Go to the 'Load Model' page and load your data files and the model file you saved before.

After loaded, you can visualize the regressors and metrics table, as well as the results and residues plots. Notice, that you can use a new dataset to check the model acuracy.

Simulate model

Go to the 'Simulate a predefined model' page, and load your test data.

Then set the nonlinearity degree of the model and prepare the regressors list (as exemplified in the tutorial), adding each group by itself. If needed, delete the list and start over.

Set the model parameters.

Set the simulation options if wanted, and then hit the 'Simulate the model' button.

Go further down to see the model equation, model metrics, results and residues plots.

Why does SysIdentPyGUI exist?

SysIdentPyGUI is an use alternative for people that would like to use SysIdentPy toolbox but aren't familiar with Python, such as medical or economy students.