Skip to main content

A Python interface to hera_matlab

Project description

HERA Logo

HERA: Hierarchical-Compensatory, Effect-Size-Driven Ranking Algorithm

MATLAB Statistics Toolbox Parallel Computing Toolbox License: MIT View on GitHub Issues PyPI Downloads DOI ORCID

Made for Scientific Benchmarking

Key FeaturesInstallationQuick StartDocumentationCitation


Overview

HERA is a MATLAB toolbox designed to automate the objective comparison of algorithms, experimental conditions, or datasets across multiple quality metrics. Unlike traditional ranking methods that rely solely on mean values or p-values, HERA employs a hierarchical-compensatory logic that integrates:

  • Significance Testing: Wilcoxon signed-rank tests for paired data.
  • Effect Sizes: Cliff's Delta and Relative Mean Difference for practical relevance.
  • Bootstrapping: Data-driven thresholds and BCa confidence intervals.

This ensures that a "win" is only counted if it is both statistically significant and practically relevant, providing a robust and nuanced ranking system.


Key Features

  • Hierarchical-Compensatory Logic: Define primary and secondary metrics. Secondary metrics can act as tie-breakers or rank correctors (e.g., M1_M2, M1_M2_M3).
  • Data-Driven Thresholds: Automatically calculates adaptive effect size thresholds using Percentile Bootstrapping.
  • Robustness: Utilizes Bias-Corrected and Accelerated (BCa) confidence intervals and Cluster Bootstrapping for rank stability.
  • Automated Reporting: Generates PDF reports, Win-Loss Matrices, Sankey Diagrams, and machine-readable JSON/CSV exports.
  • Reproducibility: Supports fixed-seed execution and configuration file-based workflows.

Installation

Requirements

  • MATLAB (R2020a or later Required)
  • Statistics and Machine Learning Toolbox (Required)
  • Parallel Computing Toolbox (Required for performance)

Setup

Option A: MATLAB Toolbox (Recommended)

  1. Download the latest HERA_v1.3.1.mltbx from the Releases page.
  2. Double-click the file to install it.
  3. Done! HERA is now available as a command (HERA.start_ranking) in MATLAB.

Option B: Git Clone (for Developers)

  1. Clone the repository:

    git clone https://github.com/lerdmann1601/HERA-Matlab.git
    
  2. Install/Configure Path:

    Navigate to the repository folder and run the setup script to add HERA to your MATLAB path.

    cd HERA-Matlab
    setup_HERA
    

👉 Standalone Runtime

👉 Python Integration

👉 Automated Build (GitHub Actions)


Quick Start

1. Interactive Mode (Recommended for Beginners)

The interactive command-line interface guides you through every step of the configuration, from data selection to statistical parameters. If you are new to HERA, this is the recommended mode. At any point, you can exit the interface by typing exit or quit or q.

HERA.start_ranking()

2. Batch Mode (Reproducible / Server)

For automated analysis or reproducible research, use a JSON configuration file. For more details on configuration parameters, see Configuration & Parameters.

HERA.start_ranking('configFile', 'config.json')

3. Unit Test Mode

Run the built-in validation suite to ensure HERA is working correctly on your system. For more details, see the Testing section.

% Run tests and save log to default location
HERA.start_ranking('runtest', 'true')

% Run tests and save log to a specific folder
HERA.start_ranking('runtest', 'true', 'logPath', '/path/to/logs')

4. Convergence Analysis

Perform a robust scientific validation of the default convergence parameters. For more details, see Convergence Analysis.

% Run analysis and save log to default location
HERA.start_ranking('convergence', 'true')

% Run analysis and save log to a specific folder
HERA.start_ranking('convergence', 'true', 'logPath', '/path/to/logs')

Note: Example use cases with synthetic datasets and results are provided in the data/examples directory. See Example Analysis for a walkthrough of the example use cases and visual examples of the ranking outputs.

Note: HERA is designed for high-performance scientific computing, featuring fully parallelized bootstrap procedures and automatic memory management to optimize efficiency. However, specifically due to the extensive use of bootstrapping, it remains a CPU-intensive application. Please ensure you have access to enough CPU cores for reasonable performance.


Documentation

👉 Repository Structure

👉 Theoretical Background

👉 Ranking Modes Explained

👉 Input Data Specification

👉 Example Analysis

👉 Methodological Guidelines & Limitations

👉 Configuration & Parameters

👉 Bootstrap Configuration

👉 Convergence Modes

👉 Convergence Analysis

👉 Advanced Usage (Developer Mode)

👉 Results Structure Reference


Outputs

HERA generates a timestamped directory containing:

Ranking_<Timestamp>/
├── Output/
│   ├── results_*.csv                 % Final ranking table (Mean ± SD of metrics and rank CI)
│   ├── data_*.json                   % Complete analysis record (Inputs, Config, Stats, Results)
│   ├── log_*.csv                     % Detailed log of pairwise comparisons and logic
│   ├── sensitivity_details_*.csv     % Results of the Borda sensitivity analysis
│   ├── BCa_Correction_Factors_*.csv  % Correction factors (Bias/Skewness) for BCa CIs
│   └── bootstrap_rank_*.csv          % Complete distribution of bootstrapped ranks
├── Graphics/                         % High-res PNGs organized in subfolders
│   ├── Ranking/
│   ├── Detail_Comparison/
│   ├── CI_Histograms/
│   └── Threshold_Analysis/
├── PDF/                              % Specialized reports
│   ├── Ranking_Report.pdf
│   ├── Convergence_Report.pdf
│   └── Bootstrap_Report.pdf
├── Final_Ranking_*.png               % Summary graphic of ranking result
├── Final_Report_*.pdf                % Consolidated graphical report of the main results
├── Ranking_*.txt                     % Complete console log of the session
└── configuration.json                % Reusable configuration file to reproduce the run

Testing

HERA includes a comprehensive validation framework (run_unit_test.m) comprising 46 test cases organized into four suites:

  1. Unit Tests (19 cases): Checks individual components, helper functions, and execution logic (Run/Start packages) to ensure specific parts of the code work correctly.
  2. Statistical Tests (5 cases): Verifies the core mathematical functions (e.g., Jackknife, Cliff's Delta) and ensures the performance optimizations (hybrid switching) work as intended.
  3. Scientific Tests (19 cases): Comprehensive validation of ranking logic, statistical accuracy, and robustness against edge cases (e.g., zero variance, outliers).
  4. System Tests (3 cases): Runs the entire HERA pipeline from start to finish to ensure that the JSON configuration (batch), Developer API and NaN Data handling are working correctly.

Running Tests

You can run the test suite in three ways:

  1. Auto-Log Mode (Default) Automatically finds a writable folder (e.g., Documents) to save the log file.

    HERA.run_unit_test()
    
  2. Interactive Mode Opens a dialog to select where to save the log file.

    HERA.run_unit_test('interactive')
    
  3. Custom Path Mode Saves the log file to a specific directory.

    HERA.run_unit_test('/path/to/my/logs')
    

GitHub Actions (Cloud Testing)

For reviewers or users without a local MATLAB license, you can run the test suite directly on GitHub:

  1. Go to the Actions tab in this repository.
  2. Select Testing HERA from the left sidebar.
  3. Click Run workflow.

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

  1. Fork the repository.
  2. Create a feature branch.
  3. Commit your changes.
  4. Open a Pull Request.

Citation

If you use HERA in your research, please cite:

@software{HERA_Matlab,
  author = {von Erdmannsdorff, Lukas},
  title = {HERA: Hierarchical-Compensatory, Effect-Size-Driven
  Ranking Algorithm},
  url = {https://github.com/lerdmann1601/HERA-Matlab},
  version = {1.3.1},
  doi = {10.5281/zenodo.18274870},
  year = {2026}
}

License

This project is licensed under the MIT License - see the LICENSE file for details.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hera_matlab-1.3.1.tar.gz (450.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hera_matlab-1.3.1-py3-none-any.whl (444.1 kB view details)

Uploaded Python 3

File details

Details for the file hera_matlab-1.3.1.tar.gz.

File metadata

  • Download URL: hera_matlab-1.3.1.tar.gz
  • Upload date:
  • Size: 450.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hera_matlab-1.3.1.tar.gz
Algorithm Hash digest
SHA256 8b3103167c6f28f90970d5ba1326cffd063f7a645b0be19831e9236407d1a14b
MD5 cce88b9d39912995fc70ede7df95bc41
BLAKE2b-256 31e45a2873cee73c9b422782f1829bed121582c40abeb715c35013d195023d6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for hera_matlab-1.3.1.tar.gz:

Publisher: publish_pypi.yml on lerdmann1601/HERA-Matlab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hera_matlab-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: hera_matlab-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 444.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hera_matlab-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6f16981bc79ac9cd464bd76c8ff48f157228685ac236e918a550d6681bff3bd2
MD5 7269e297de073e7524b628d23c21479e
BLAKE2b-256 8590c9cf441e6d4a1d2dd5657b277823935e4d1c6a8aba5379052c112e9ad6e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for hera_matlab-1.3.1-py3-none-any.whl:

Publisher: publish_pypi.yml on lerdmann1601/HERA-Matlab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page