BenchPOTS
raw JSON → 0.5 verified Mon Apr 27 auth: no python
A Python toolbox for benchmarking machine learning on partially-observed time series. Supports preprocessing of 170+ open-source datasets including UCR&UEA, PhysioNet, air quality, electricity, and traffic data. Current version is 0.5, with active development on GitHub.
pip install benchpots Common errors
error ModuleNotFoundError: No module named 'benchpots' ↓
cause Package not installed.
fix
Run 'pip install benchpots' to install.
error AttributeError: module 'benchpots' has no attribute 'preprocess_ucr_uea' ↓
cause Function is in a submodule, not top-level.
fix
Use 'from benchpots.datasets import preprocess_ucr_uea' instead.
error ValueError: Dataset not found at path ↓
cause The required dataset files are missing from the specified data_path.
fix
Download the dataset files manually and set the correct data_path parameter.
Warnings
breaking In v0.3.2, the sliding window function had a tensor sample stacking bug that was fixed. If you used v0.3.1 or earlier, sliding window outputs may have incorrect shapes. ↓
fix Upgrade to v0.3.2 or later: pip install benchpots>=0.3.2
deprecated The preprocess_physionet2012 function may change its return format in future releases. It currently returns a dictionary with keys 'X', 'y', 'M', etc., but this is not guaranteed stable. ↓
fix Check return structure in each version's documentation.
gotcha Some datasets require manual download or specific file paths. For example, PhysioNet data must be downloaded separately. The function will not automatically fetch missing files. ↓
fix Pre-download the dataset files and provide the correct data_path.
gotcha The 'UCR&UEA' datasets with string labels in v0.2.1 and earlier caused loading errors. This was fixed in v0.2.2, but string labels are encoded into int. Be aware of label encoding changes. ↓
fix Upgrade to v0.2.2+ or manually encode labels.
Imports
- preprocess_physionet2012
from benchpots.datasets import preprocess_physionet2012 - preprocess_ucr_uea wrong
from benchpots import preprocess_ucr_ueacorrectfrom benchpots.datasets import preprocess_ucr_uea
Quickstart
from benchpots.datasets import preprocess_physionet2012
import os
# Download and preprocess PhysioNet-2012 dataset
data = preprocess_physionet2012(
data_path=os.environ.get('DATA_PATH', './data'),
artifact_path=os.environ.get('ARTIFACT_PATH', './results')
)
print(data.keys())