UCI HAR activity classifier (subject-held-out baseline)

Classifies six daily activities (walking, walking upstairs, walking downstairs, sitting, standing, lying) from the 561 precomputed smartphone inertial features of the UCI HAR dataset. Part of the QMASE research engine.

Evaluation

The official UCI HAR split keeps volunteers separate: 21 subjects train (7352 windows), 9 different subjects test (2947 windows). The model was chosen by GroupKFold(5) over training subjects, macro-F1 without touching the test subjects, then evaluated once.

Candidate (CV over training subjects) Macro-F1
logistic_regression 0.934 ± 0.041
random_forest 0.916 ± 0.045

Selected: logistic_regression. Held-out subjects: accuracy 0.955, macro-F1 0.954. Per-subject accuracy ranges from 0.864 to 0.995 (median 0.962).

Activity F1
WALKING 0.968
WALKING_UPSTAIRS 0.951
WALKING_DOWNSTAIRS 0.962
SITTING 0.920
STANDING 0.930
LAYING 0.995

Usage

import joblib
from huggingface_hub import hf_hub_download
model = joblib.load(hf_hub_download("makactuary/uci-har-activity-baseline", "model.joblib"))
predictions = model.predict(X)  # X: (n, 561) UCI HAR feature windows

Trained with scikit-learn 1.9.1; load it with the same scikit-learn version (pickled models are version-sensitive). Code: har_baseline.py.

Limitations

  • Daily activities recorded with a waist-mounted smartphone in a lab protocol; not martial-arts techniques, effort, fatigue or injury risk.
  • 30 volunteers aged 19–48; performance on other devices, placements or populations is unknown.
  • Uses the dataset's precomputed features; raw-signal deep models are a different task.

Data and licence

UCI HAR is licensed CC BY 4.0. Reyes-Ortiz, J., Anguita, D., Ghio, A., Oneto, L. & Parra, X. (2013). Human Activity Recognition Using Smartphones [Dataset]. UCI Machine Learning Repository. https://doi.org/10.24432/C54S4K

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including makactuary/uci-har-activity-baseline