Skip to main content

BenchmarkHAR

BenchmarkHAR is a Human Activity Recognition (HAR) benchmarking framework for classical machine learning, deep learning, and external foundation-model adapters.

The library is packaged as a standard Python package and can be installed with pip.

Important:

  • The core framework lives in benchmarkhar/.
  • Raw datasets and research outputs stay outside the installable wheel.
  • External repositories such as BioPM and TinyHAR / ISWC22_HAR are treated as optional dependencies or adapters rather than being merged into the core package.

Installation

From the repository root:

pip install .

Optional feature sets:

pip install ".[deep-learning]"
pip install ".[visualization]"
pip install ".[all]"

Package structure

BenchmarkHAR/
├── src/
│   └── benchmarkhar/
│       ├── datasets/
│       ├── models/
│       ├── preprocessing/
│       ├── features/
│       ├── dimension_reduction/
│       ├── utils/
│       ├── cli.py
│       └── __init__.py
├── configs/
├── scripts/
├── data/
├── results/
├── tests/
├── pyproject.toml
├── requirements.txt
├── README.md
└── LICENSE

Python usage

import benchmarkhar
from benchmarkhar.utils.load_config import load_config

config = load_config("pamap2")
print(config["name"])

The recommended pattern is to keep datasets and generated artifacts under a project root you control:

from benchmarkhar.utils.load_config import load_config

config = load_config("pamap2", root="/path/to/your/project")
print(config["raw_path"])

Dataset loading

BenchmarkHAR expects datasets to be provided separately from the wheel. The repo contains dataset YAML files in configs/datasets/, but raw data is never bundled into the package.

Typical usage:

from benchmarkhar.utils.load_config import load_dataset

cfg = load_dataset("pamap2", root="/path/to/data-root")

Preprocessing

from benchmarkhar.preprocessing.windowing import sliding_window_multilabel
import numpy as np

X = np.random.randn(100, 3).astype(np.float32)
labels = {"activity_id": np.array(["Walking"] * 100, dtype=object)}
windows, out_labels = sliding_window_multilabel(X, labels, window_size=10, step_size=5)

Models

Core model registry:

from benchmarkhar.models import MODEL_REGISTRY
print(sorted(MODEL_REGISTRY))

Common models include:

  • random_forest
  • logistic_regression
  • cnn, lstm, dnn, rnn, deepconv_lstm
  • tinyhar (when the external TinyHAR repository is available)
  • astar_har
  • biopm (via the external BioPM dependency / adapter)

External model repositories

BenchmarkHAR keeps external repositories separate from the core package.

BioPM

BioPM should be cloned separately and made importable through your environment, or used via the adapter class:

from benchmarkhar.models import BioPM

bio = BioPM()

This wrapper intentionally does not copy or rewrite the BioPM source code. It only adapts the external dependency to the benchmark interface.

TinyHAR / ISWC22_HAR

from benchmarkhar.models import TinyHAR

tiny = TinyHAR()

If the external TinyHAR repository is not available, the adapter raises a clear ImportError explaining how to install it.

CLI

The installable CLI is available after installation:

benchmarkhar --help
benchmarkhar --list-datasets

Experimental scripts

Research scripts are kept under scripts/ and are not installed as library modules. They can still be run from the repository checkout:

python scripts/run.py --dataset pamap2 --model random_forest --step full

Testing

From the repository root:

python -m pytest -q

Build

python -m build

Citation / provenance

BenchmarkHAR is designed to preserve external repositories used in the benchmark pipeline.

  • BioPM: please cite the original BioPM publication and repository.
  • TinyHAR / ISWC22_HAR: please cite the original TinyHAR / ISWC22_HAR paper and repository.

Notes

  • Raw data, processed artifacts, and experiment outputs remain outside the wheel.
  • The project is built to work from any Python environment after pip install ..
  • The installation is intentionally compatible with a research workflow that stores data and checkpoints outside the package.

Metadata

Release files for benchmarkhar 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for benchmarkhar 0.1.0
File Size Uploaded Provenance Actions
benchmarkhar-0.1.0.tar.gz 45.1 kB Without provenance Details for benchmarkhar-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for benchmarkhar 0.1.0
File Interpreter ABI Platform Actions
benchmarkhar-0.1.0-py3-none-any.whl Python 3 none any Details for benchmarkhar-0.1.0-py3-none-any.whl

Total release size: 106.1 kB

Release files / benchmarkhar-0.1.0.tar.gz

Download URL benchmarkhar-0.1.0.tar.gz
Size 45.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1af340ba0585f345e01d21b7d4f86990007dc8f119358d327d4e75f1705cd5f2
BLAKE2b-256 checksum
How to use checksums
aa334cd8b216120b25cc6dda2b99af9047aae10ec99d4973b015b55ef1fb2a6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release files / benchmarkhar-0.1.0-py3-none-any.whl

Download URL benchmarkhar-0.1.0-py3-none-any.whl
Size 60.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7859211e9ce6f7fb8f7dc22e3bfd28e4a72e81eeff336562ee91f4f7288bf1c
BLAKE2b-256 checksum
How to use checksums
d291123ef2392b1f6509713050f554841ec144e0dd876311e256059d37d33baf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Security for benchmarkhar 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page