identibench 0.0.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. identibench-0.0.8/.github/workflows/deploy.yaml +14 -0
  2. identibench-0.0.8/.github/workflows/test.yaml +7 -0
  3. identibench-0.0.8/.gitignore +151 -0
  4. identibench-0.0.8/LICENSE +21 -0
  5. identibench-0.0.8/MANIFEST.in +5 -0
  6. identibench-0.0.8/PKG-INFO +169 -0
  7. identibench-0.0.8/README.md +122 -0
  8. identibench-0.0.8/assets/logo.svg +182 -0
  9. identibench-0.0.8/assets/logo_sysbench.png +0 -0
  10. identibench-0.0.8/identibench/__init__.py +54 -0
  11. identibench-0.0.8/identibench/_modidx.py +144 -0
  12. identibench-0.0.8/identibench/benchmark.py +404 -0
  13. identibench-0.0.8/identibench/datasets/__init__.py +26 -0
  14. identibench-0.0.8/identibench/datasets/broad.py +58 -0
  15. identibench-0.0.8/identibench/datasets/industrial_robot.py +128 -0
  16. identibench-0.0.8/identibench/datasets/quad_pelican.py +158 -0
  17. identibench-0.0.8/identibench/datasets/quad_pi.py +348 -0
  18. identibench-0.0.8/identibench/datasets/ship.py +96 -0
  19. identibench-0.0.8/identibench/datasets/workshop.py +254 -0
  20. identibench-0.0.8/identibench/metrics.py +147 -0
  21. identibench-0.0.8/identibench/utils.py +209 -0
  22. identibench-0.0.8/identibench.egg-info/PKG-INFO +169 -0
  23. identibench-0.0.8/identibench.egg-info/SOURCES.txt +45 -0
  24. identibench-0.0.8/identibench.egg-info/dependency_links.txt +1 -0
  25. identibench-0.0.8/identibench.egg-info/entry_points.txt +2 -0
  26. identibench-0.0.8/identibench.egg-info/not-zip-safe +1 -0
  27. identibench-0.0.8/identibench.egg-info/requires.txt +13 -0
  28. identibench-0.0.8/identibench.egg-info/top_level.txt +1 -0
  29. identibench-0.0.8/nbs/_quarto.yml +24 -0
  30. identibench-0.0.8/nbs/benchmark.ipynb +936 -0
  31. identibench-0.0.8/nbs/datasets/broad.ipynb +137 -0
  32. identibench-0.0.8/nbs/datasets/industrial_robot.ipynb +400 -0
  33. identibench-0.0.8/nbs/datasets/quad_pelican.ipynb +299 -0
  34. identibench-0.0.8/nbs/datasets/quadrotor_pi.ipynb +91572 -0
  35. identibench-0.0.8/nbs/datasets/ship.ipynb +373 -0
  36. identibench-0.0.8/nbs/datasets/workshop.ipynb +187510 -0
  37. identibench-0.0.8/nbs/index.ipynb +187 -0
  38. identibench-0.0.8/nbs/metrics.ipynb +544 -0
  39. identibench-0.0.8/nbs/nbdev.yml +9 -0
  40. identibench-0.0.8/nbs/sidebar.yml +15 -0
  41. identibench-0.0.8/nbs/styles.css +37 -0
  42. identibench-0.0.8/nbs/utils.ipynb +570 -0
  43. identibench-0.0.8/pyproject.toml +15 -0
  44. identibench-0.0.8/settings.ini +40 -0
  45. identibench-0.0.8/setup.cfg +4 -0
  46. identibench-0.0.8/setup.py +57 -0
  47. identibench-0.0.8/uv.lock +3289 -0
@@ -0,0 +1,14 @@
1
+ name: Deploy to GitHub Pages
2
+
3
+ permissions:
4
+ contents: write
5
+ pages: write
6
+
7
+ on:
8
+ push:
9
+ branches: [ "main", "master" ]
10
+ workflow_dispatch:
11
+ jobs:
12
+ deploy:
13
+ runs-on: ubuntu-latest
14
+ steps: [uses: fastai/workflows/quarto-ghp@master]
@@ -0,0 +1,7 @@
1
+ name: CI
2
+ on: [workflow_dispatch, pull_request, push]
3
+
4
+ jobs:
5
+ test:
6
+ runs-on: ubuntu-latest
7
+ steps: [uses: fastai/workflows/nbdev-ci@master]
@@ -0,0 +1,151 @@
1
+ _docs/
2
+ _proc/
3
+
4
+ *.bak
5
+ .gitattributes
6
+ .last_checked
7
+ .gitconfig
8
+ *.bak
9
+ *.log
10
+ *~
11
+ ~*
12
+ _tmp*
13
+ tmp*
14
+ tags
15
+ *.pkg
16
+
17
+ # Byte-compiled / optimized / DLL files
18
+ __pycache__/
19
+ *.py[cod]
20
+ *$py.class
21
+
22
+ # C extensions
23
+ *.so
24
+
25
+ # Distribution / packaging
26
+ .Python
27
+ env/
28
+ build/
29
+ develop-eggs/
30
+ dist/
31
+ downloads/
32
+ eggs/
33
+ .eggs/
34
+ lib/
35
+ lib64/
36
+ parts/
37
+ sdist/
38
+ var/
39
+ wheels/
40
+ *.egg-info/
41
+ .installed.cfg
42
+ *.egg
43
+
44
+ # PyInstaller
45
+ # Usually these files are written by a python script from a template
46
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
47
+ *.manifest
48
+ *.spec
49
+
50
+ # Installer logs
51
+ pip-log.txt
52
+ pip-delete-this-directory.txt
53
+
54
+ # Unit test / coverage reports
55
+ htmlcov/
56
+ .tox/
57
+ .coverage
58
+ .coverage.*
59
+ .cache
60
+ nosetests.xml
61
+ coverage.xml
62
+ *.cover
63
+ .hypothesis/
64
+
65
+ # Translations
66
+ *.mo
67
+ *.pot
68
+
69
+ # Django stuff:
70
+ *.log
71
+ local_settings.py
72
+
73
+ # Flask stuff:
74
+ instance/
75
+ .webassets-cache
76
+
77
+ # Scrapy stuff:
78
+ .scrapy
79
+
80
+ # Sphinx documentation
81
+ docs/_build/
82
+
83
+ # PyBuilder
84
+ target/
85
+
86
+ # Jupyter Notebook
87
+ .ipynb_checkpoints
88
+
89
+ # pyenv
90
+ .python-version
91
+
92
+ # celery beat schedule file
93
+ celerybeat-schedule
94
+
95
+ # SageMath parsed files
96
+ *.sage.py
97
+
98
+ # dotenv
99
+ .env
100
+
101
+ # virtualenv
102
+ .venv
103
+ venv/
104
+ ENV/
105
+
106
+ # Spyder project settings
107
+ .spyderproject
108
+ .spyproject
109
+
110
+ # Rope project settings
111
+ .ropeproject
112
+
113
+ # mkdocs documentation
114
+ /site
115
+
116
+ # mypy
117
+ .mypy_cache/
118
+
119
+ .vscode
120
+ *.swp
121
+
122
+ # osx generated files
123
+ .DS_Store
124
+ .DS_Store?
125
+ .Trashes
126
+ ehthumbs.db
127
+ Thumbs.db
128
+ .idea
129
+
130
+ # pytest
131
+ .pytest_cache
132
+
133
+ # tools/trust-doc-nbs
134
+ docs_src/.last_checked
135
+
136
+ # symlinks to fastai
137
+ docs_src/fastai
138
+ tools/fastai
139
+
140
+ # link checker
141
+ checklink/cookies.txt
142
+
143
+ # .gitconfig is now autogenerated
144
+ .gitconfig
145
+
146
+ # Quarto installer
147
+ .deb
148
+ .pkg
149
+
150
+ # Quarto
151
+ .quarto
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Daniel Weber
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ include settings.ini
2
+ include LICENSE
3
+ include CONTRIBUTING.md
4
+ include README.md
5
+ recursive-exclude * __pycache__
@@ -0,0 +1,169 @@
1
+ Metadata-Version: 2.4
2
+ Name: identibench
3
+ Version: 0.0.8
4
+ Summary: Downloads and prepares various system identification benchmark datasets
5
+ Home-page: https://github.com/daniel-om-weber/identibench
6
+ Author: Daniel Weber
7
+ Author-email: daniel.om.weber@gmail.com
8
+ License: Apache Software License 2.0
9
+ Keywords: nbdev jupyter notebook python
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Natural Language :: English
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: License :: OSI Approved :: Apache Software License
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: nonlinear-benchmarks
23
+ Requires-Dist: h5py
24
+ Requires-Dist: easyDataverse>=0.4.4
25
+ Requires-Dist: pandas
26
+ Requires-Dist: gdown
27
+ Requires-Dist: bagpy
28
+ Provides-Extra: dev
29
+ Requires-Dist: matplotlib; extra == "dev"
30
+ Requires-Dist: nbdev; extra == "dev"
31
+ Requires-Dist: ipykernel; extra == "dev"
32
+ Requires-Dist: sysidentpy; extra == "dev"
33
+ Requires-Dist: twine; extra == "dev"
34
+ Dynamic: author
35
+ Dynamic: author-email
36
+ Dynamic: classifier
37
+ Dynamic: description
38
+ Dynamic: description-content-type
39
+ Dynamic: home-page
40
+ Dynamic: keywords
41
+ Dynamic: license
42
+ Dynamic: license-file
43
+ Dynamic: provides-extra
44
+ Dynamic: requires-dist
45
+ Dynamic: requires-python
46
+ Dynamic: summary
47
+
48
+
49
+
50
+ <img src="https://raw.githubusercontent.com/daniel-om-weber/identibench/main/assets/logo.svg" width="200" align="left" alt="identibench logo">
51
+
52
+ <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
53
+
54
+ ## identibench
55
+
56
+ The `identibench` package provides a collection of standardized data
57
+ loaders for common system identification benchmark datasets. It
58
+ downloads, prepares, and converts various benchmark datasets into a
59
+ unified HDF5 format, making them readily available for machine learning
60
+ and system identification applications.
61
+
62
+ ## Install
63
+
64
+ ``` sh
65
+ pip install identibench
66
+ ```
67
+
68
+ ## Features
69
+
70
+ - Downloads benchmark datasets from various sources
71
+ - Converts data to standardized HDF5 format
72
+ - Splits data into train/validation/test sets
73
+ - Provides consistent interface across different benchmarks
74
+ - Handles setup and cleanup of downloaded files
75
+
76
+ ## Available Benchmarks
77
+
78
+ The package includes loaders for the following benchmark datasets:
79
+
80
+ ### Nonlinear Systemidentification Workshop Benchmarks
81
+
82
+ - **Wiener-Hammerstein**: Electronic nonlinear system
83
+ - **Silverbox**: Electronic circuit with nonlinear feedback
84
+ - **Cascaded Tanks**: Fluid dynamics system
85
+ - **EMPS**: Electro-Mechanical Positioning System
86
+ - **Noisy Wiener-Hammerstein**: WH system with process noise
87
+
88
+ ### Robotic Systems
89
+
90
+ - **Industrial Robot**: Forward and inverse identification models
91
+ - **Quad Pelican**: Quadrotor UAV system
92
+ - **Quad Pi**: Raspberry Pi-based quadrotor system
93
+
94
+ ### Other Systems
95
+
96
+ - **Ship**: Ship propulsion and steering dynamics
97
+ - **Broad**: Broad spectrum system identification dataset
98
+
99
+ ``` python
100
+ # Basic usage
101
+ import identibench as idb
102
+ from pathlib import Path
103
+
104
+ # Example: Download a single dataset
105
+ # Note: Always use a Path object, not a string
106
+ save_path = Path('./tmp/wh')
107
+ idb.datasets.workshop.wiener_hammerstein(save_path)
108
+ ```
109
+
110
+ ``` python
111
+ from sysidentpy.model_structure_selection import FROLS
112
+ from sysidentpy.parameter_estimation import LeastSquares
113
+ def build_frols_model(context):
114
+ u_train, y_train, _ = next(context.get_train_sequences())
115
+
116
+ ylag = context.hyperparameters.get('ylag', 5)
117
+ xlag = context.hyperparameters.get('xlag', 5)
118
+ n_terms = context.hyperparameters.get('n_terms', 10)
119
+ estimator = context.hyperparameters.get('estimator', LeastSquares())
120
+
121
+ _model = FROLS(xlag=xlag, ylag=ylag, n_terms=n_terms,estimator=estimator)
122
+ _model.fit(X=u_train, y=y_train)
123
+
124
+ def model(u_test, y_init):
125
+ nonlocal _model
126
+ yhat_full = _model.predict(X=u_test, y=y_init[:_model.max_lag])
127
+ y_pred = yhat_full[_model.max_lag:]
128
+ return y_pred
129
+
130
+ return model
131
+ ```
132
+
133
+ ``` python
134
+ hyperparams = {
135
+ 'ylag': 2,
136
+ 'xlag': 2,
137
+ 'n_terms': 10, # Number of terms for FROLS
138
+ 'estimator': LeastSquares()
139
+ }
140
+
141
+ idb.run_benchmark(
142
+ spec=idb.BenchmarkWH_Simulation,
143
+ build_model=build_frols_model,
144
+ hyperparameters=hyperparams
145
+ )
146
+ ```
147
+
148
+ {'benchmark_name': 'BenchmarkWH_Simulation',
149
+ 'dataset_id': 'wh',
150
+ 'hyperparameters': {'ylag': 2,
151
+ 'xlag': 2,
152
+ 'n_terms': 10,
153
+ 'estimator': <sysidentpy.parameter_estimation.estimators.LeastSquares>},
154
+ 'seed': 3194310919,
155
+ 'training_time_seconds': 0.9640552089986159,
156
+ 'test_time_seconds': 1.0245963339984883,
157
+ 'benchmark_type': 'BenchmarkSpecSimulation',
158
+ 'metric_score': 0.2059879758473603}
159
+
160
+ ## HDF5 Data Format
161
+
162
+ Each dataset is converted to a standard HDF5 format with the following
163
+ structure: - Train/valid/test split in separate directories - Input data
164
+ stored as ‘u0’, ‘u1’, etc. (one per input dimension) - Output data
165
+ stored as ‘y0’, ‘y1’, etc. (one per output dimension) - Data converted
166
+ to 32-bit float (f4) for consistency
167
+
168
+ This standardized format makes it easy to use these datasets with any
169
+ machine learning framework that supports HDF5 files.
@@ -0,0 +1,122 @@
1
+
2
+
3
+ <img src="https://raw.githubusercontent.com/daniel-om-weber/identibench/main/assets/logo.svg" width="200" align="left" alt="identibench logo">
4
+
5
+ <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
6
+
7
+ ## identibench
8
+
9
+ The `identibench` package provides a collection of standardized data
10
+ loaders for common system identification benchmark datasets. It
11
+ downloads, prepares, and converts various benchmark datasets into a
12
+ unified HDF5 format, making them readily available for machine learning
13
+ and system identification applications.
14
+
15
+ ## Install
16
+
17
+ ``` sh
18
+ pip install identibench
19
+ ```
20
+
21
+ ## Features
22
+
23
+ - Downloads benchmark datasets from various sources
24
+ - Converts data to standardized HDF5 format
25
+ - Splits data into train/validation/test sets
26
+ - Provides consistent interface across different benchmarks
27
+ - Handles setup and cleanup of downloaded files
28
+
29
+ ## Available Benchmarks
30
+
31
+ The package includes loaders for the following benchmark datasets:
32
+
33
+ ### Nonlinear Systemidentification Workshop Benchmarks
34
+
35
+ - **Wiener-Hammerstein**: Electronic nonlinear system
36
+ - **Silverbox**: Electronic circuit with nonlinear feedback
37
+ - **Cascaded Tanks**: Fluid dynamics system
38
+ - **EMPS**: Electro-Mechanical Positioning System
39
+ - **Noisy Wiener-Hammerstein**: WH system with process noise
40
+
41
+ ### Robotic Systems
42
+
43
+ - **Industrial Robot**: Forward and inverse identification models
44
+ - **Quad Pelican**: Quadrotor UAV system
45
+ - **Quad Pi**: Raspberry Pi-based quadrotor system
46
+
47
+ ### Other Systems
48
+
49
+ - **Ship**: Ship propulsion and steering dynamics
50
+ - **Broad**: Broad spectrum system identification dataset
51
+
52
+ ``` python
53
+ # Basic usage
54
+ import identibench as idb
55
+ from pathlib import Path
56
+
57
+ # Example: Download a single dataset
58
+ # Note: Always use a Path object, not a string
59
+ save_path = Path('./tmp/wh')
60
+ idb.datasets.workshop.wiener_hammerstein(save_path)
61
+ ```
62
+
63
+ ``` python
64
+ from sysidentpy.model_structure_selection import FROLS
65
+ from sysidentpy.parameter_estimation import LeastSquares
66
+ def build_frols_model(context):
67
+ u_train, y_train, _ = next(context.get_train_sequences())
68
+
69
+ ylag = context.hyperparameters.get('ylag', 5)
70
+ xlag = context.hyperparameters.get('xlag', 5)
71
+ n_terms = context.hyperparameters.get('n_terms', 10)
72
+ estimator = context.hyperparameters.get('estimator', LeastSquares())
73
+
74
+ _model = FROLS(xlag=xlag, ylag=ylag, n_terms=n_terms,estimator=estimator)
75
+ _model.fit(X=u_train, y=y_train)
76
+
77
+ def model(u_test, y_init):
78
+ nonlocal _model
79
+ yhat_full = _model.predict(X=u_test, y=y_init[:_model.max_lag])
80
+ y_pred = yhat_full[_model.max_lag:]
81
+ return y_pred
82
+
83
+ return model
84
+ ```
85
+
86
+ ``` python
87
+ hyperparams = {
88
+ 'ylag': 2,
89
+ 'xlag': 2,
90
+ 'n_terms': 10, # Number of terms for FROLS
91
+ 'estimator': LeastSquares()
92
+ }
93
+
94
+ idb.run_benchmark(
95
+ spec=idb.BenchmarkWH_Simulation,
96
+ build_model=build_frols_model,
97
+ hyperparameters=hyperparams
98
+ )
99
+ ```
100
+
101
+ {'benchmark_name': 'BenchmarkWH_Simulation',
102
+ 'dataset_id': 'wh',
103
+ 'hyperparameters': {'ylag': 2,
104
+ 'xlag': 2,
105
+ 'n_terms': 10,
106
+ 'estimator': <sysidentpy.parameter_estimation.estimators.LeastSquares>},
107
+ 'seed': 3194310919,
108
+ 'training_time_seconds': 0.9640552089986159,
109
+ 'test_time_seconds': 1.0245963339984883,
110
+ 'benchmark_type': 'BenchmarkSpecSimulation',
111
+ 'metric_score': 0.2059879758473603}
112
+
113
+ ## HDF5 Data Format
114
+
115
+ Each dataset is converted to a standard HDF5 format with the following
116
+ structure: - Train/valid/test split in separate directories - Input data
117
+ stored as ‘u0’, ‘u1’, etc. (one per input dimension) - Output data
118
+ stored as ‘y0’, ‘y1’, etc. (one per output dimension) - Data converted
119
+ to 32-bit float (f4) for consistency
120
+
121
+ This standardized format makes it easy to use these datasets with any
122
+ machine learning framework that supports HDF5 files.