Metadata-Version: 2.4
Name: identibench
Version: 0.0.8
Summary: Downloads and prepares various system identification benchmark datasets
Home-page: https://github.com/daniel-om-weber/identibench
Author: Daniel Weber
Author-email: daniel.om.weber@gmail.com
License: Apache Software License 2.0
Keywords: nbdev jupyter notebook python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: nonlinear-benchmarks
Requires-Dist: h5py
Requires-Dist: easyDataverse>=0.4.4
Requires-Dist: pandas
Requires-Dist: gdown
Requires-Dist: bagpy
Provides-Extra: dev
Requires-Dist: matplotlib; extra == "dev"
Requires-Dist: nbdev; extra == "dev"
Requires-Dist: ipykernel; extra == "dev"
Requires-Dist: sysidentpy; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary



<img src="https://raw.githubusercontent.com/daniel-om-weber/identibench/main/assets/logo.svg" width="200" align="left" alt="identibench logo">

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## identibench

The `identibench` package provides a collection of standardized data
loaders for common system identification benchmark datasets. It
downloads, prepares, and converts various benchmark datasets into a
unified HDF5 format, making them readily available for machine learning
and system identification applications.

## Install

``` sh
pip install identibench
```

## Features

- Downloads benchmark datasets from various sources
- Converts data to standardized HDF5 format
- Splits data into train/validation/test sets
- Provides consistent interface across different benchmarks
- Handles setup and cleanup of downloaded files

## Available Benchmarks

The package includes loaders for the following benchmark datasets:

### Nonlinear Systemidentification Workshop Benchmarks

- **Wiener-Hammerstein**: Electronic nonlinear system
- **Silverbox**: Electronic circuit with nonlinear feedback
- **Cascaded Tanks**: Fluid dynamics system
- **EMPS**: Electro-Mechanical Positioning System
- **Noisy Wiener-Hammerstein**: WH system with process noise

### Robotic Systems

- **Industrial Robot**: Forward and inverse identification models
- **Quad Pelican**: Quadrotor UAV system
- **Quad Pi**: Raspberry Pi-based quadrotor system

### Other Systems

- **Ship**: Ship propulsion and steering dynamics
- **Broad**: Broad spectrum system identification dataset

``` python
# Basic usage
import identibench as idb
from pathlib import Path

# Example: Download a single dataset
# Note: Always use a Path object, not a string
save_path = Path('./tmp/wh')
idb.datasets.workshop.wiener_hammerstein(save_path)
```

``` python
from sysidentpy.model_structure_selection import FROLS
from sysidentpy.parameter_estimation import LeastSquares
def build_frols_model(context):
    u_train, y_train, _ = next(context.get_train_sequences())
    
    ylag = context.hyperparameters.get('ylag', 5)
    xlag = context.hyperparameters.get('xlag', 5)
    n_terms = context.hyperparameters.get('n_terms', 10)
    estimator = context.hyperparameters.get('estimator', LeastSquares())

    _model = FROLS(xlag=xlag, ylag=ylag, n_terms=n_terms,estimator=estimator)
    _model.fit(X=u_train, y=y_train)

    def model(u_test, y_init):
        nonlocal _model
        yhat_full = _model.predict(X=u_test, y=y_init[:_model.max_lag])
        y_pred = yhat_full[_model.max_lag:]
        return y_pred
    
    return model
```

``` python
hyperparams = {
    'ylag': 2,
    'xlag': 2,
    'n_terms': 10, # Number of terms for FROLS
    'estimator': LeastSquares()
}

idb.run_benchmark(
    spec=idb.BenchmarkWH_Simulation,
    build_model=build_frols_model,
    hyperparameters=hyperparams
)
```

    {'benchmark_name': 'BenchmarkWH_Simulation',
     'dataset_id': 'wh',
     'hyperparameters': {'ylag': 2,
      'xlag': 2,
      'n_terms': 10,
      'estimator': <sysidentpy.parameter_estimation.estimators.LeastSquares>},
     'seed': 3194310919,
     'training_time_seconds': 0.9640552089986159,
     'test_time_seconds': 1.0245963339984883,
     'benchmark_type': 'BenchmarkSpecSimulation',
     'metric_score': 0.2059879758473603}

## HDF5 Data Format

Each dataset is converted to a standard HDF5 format with the following
structure: - Train/valid/test split in separate directories - Input data
stored as ‘u0’, ‘u1’, etc. (one per input dimension) - Output data
stored as ‘y0’, ‘y1’, etc. (one per output dimension) - Data converted
to 32-bit float (f4) for consistency

This standardized format makes it easy to use these datasets with any
machine learning framework that supports HDF5 files.
