diff --git a/configs/ordering/adl_wrist_accel_v1.csv.gz b/configs/ordering/adl_wrist_accel_v1.csv.gz new file mode 100644 index 0000000000000000000000000000000000000000..97b4936bb7e734c977c59f363695ecfdb6d9a651 --- /dev/null +++ b/configs/ordering/adl_wrist_accel_v1.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c486fb00a2fc0fdb82401ff8c1520d964c565cbb342fe66a0d55be6281a99ab +size 129932 diff --git a/configs/ordering/capture24_wearable_activity_v1.csv.gz b/configs/ordering/capture24_wearable_activity_v1.csv.gz new file mode 100644 index 0000000000000000000000000000000000000000..c9e1f17955728a63bb792d90c02a89f7d6fe7530 --- /dev/null +++ b/configs/ordering/capture24_wearable_activity_v1.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:684edcb4b574e97d168629549da88c9ad740e487e1d2957a7460c32a2233e230 +size 1816840 diff --git a/configs/ordering/domino_watch_accel_v1.csv.gz b/configs/ordering/domino_watch_accel_v1.csv.gz new file mode 100644 index 0000000000000000000000000000000000000000..15ea25eb7cdb55e5aa121df6e3a362bf2a7314cd --- /dev/null +++ b/configs/ordering/domino_watch_accel_v1.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a271a3533d715a9ce58e8695be7c639f89a8f536ea42875afa73bf1247b107df +size 460553 diff --git a/configs/ordering/gotov_wrist_accel_v1.csv.gz b/configs/ordering/gotov_wrist_accel_v1.csv.gz new file mode 100644 index 0000000000000000000000000000000000000000..e2de07f16c19815a19b31ba2d7eb46e888a4a0b0 --- /dev/null +++ b/configs/ordering/gotov_wrist_accel_v1.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23d27a065e6354f198e093cad72962a9bf1e250c7441d5bf1d54132aa68c0686 +size 1308437 diff --git a/configs/ordering/handy_wrist_accel_v1.csv.gz b/configs/ordering/handy_wrist_accel_v1.csv.gz new file mode 100644 index 0000000000000000000000000000000000000000..d0e096f0040ffc2612a2dc6f83ab158a149c09a4 --- /dev/null +++ b/configs/ordering/handy_wrist_accel_v1.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e0bd505b7ac7ed65d75484ff29cce08955e57439c8bdba0d375937f18054fc9 +size 245889 diff --git a/configs/ordering/harmes_left_wrist_accel_v1.csv.gz b/configs/ordering/harmes_left_wrist_accel_v1.csv.gz new file mode 100644 index 0000000000000000000000000000000000000000..c1c32adf4f16b8cc417e8cd97465bf5d97976e88 --- /dev/null +++ b/configs/ordering/harmes_left_wrist_accel_v1.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dba51cf701f2e99fb37c30b9d9a666faaf4b75fe97d405bf756fc477704e0d3c +size 1700615 diff --git a/configs/ordering/harmes_right_wrist_accel_v1.csv.gz b/configs/ordering/harmes_right_wrist_accel_v1.csv.gz new file mode 100644 index 0000000000000000000000000000000000000000..4514d43848d7f983206b16605a497a27e7286abd --- /dev/null +++ b/configs/ordering/harmes_right_wrist_accel_v1.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7da5f2b6dca7ddcb6a4f181738b50ad72456de047f2c288d93dd21a490c2f97b +size 1700996 diff --git a/configs/ordering/iuwds_wrist_accel_v1.csv.gz b/configs/ordering/iuwds_wrist_accel_v1.csv.gz new file mode 100644 index 0000000000000000000000000000000000000000..182303e1cce31cc4e31871c1f8c5970f4398b781 --- /dev/null +++ b/configs/ordering/iuwds_wrist_accel_v1.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22d7b19b088b9221f6f11eec24e4f792cf2816754ed12084c1cbe727ea2b7e57 +size 1374747 diff --git a/configs/ordering/mhealth_right_lower_arm_v1.csv.gz b/configs/ordering/mhealth_right_lower_arm_v1.csv.gz new file mode 100644 index 0000000000000000000000000000000000000000..7f84045bcac968c94b33dd183f6e65da4a49e88e --- /dev/null +++ b/configs/ordering/mhealth_right_lower_arm_v1.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a16623bcd3946ef4d45f49a4003bf16f78697831892342d22d0187ec56a0d777 +size 99644 diff --git a/configs/ordering/paal_adl_wrist_accel_v1.csv.gz b/configs/ordering/paal_adl_wrist_accel_v1.csv.gz new file mode 100644 index 0000000000000000000000000000000000000000..bb8fef2e64e675fc9e04c07d2042c11e50559f04 --- /dev/null +++ b/configs/ordering/paal_adl_wrist_accel_v1.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c717390251fa1febf14bc2a2302e16254927e8b87e9d88e9f7f9e4b471b08ebd +size 400953 diff --git a/configs/ordering/pamap2_hand_imu_v1.csv.gz b/configs/ordering/pamap2_hand_imu_v1.csv.gz new file mode 100644 index 0000000000000000000000000000000000000000..bc27f095a5522308a98e2f6a3e756d2cc1ed0069 --- /dev/null +++ b/configs/ordering/pamap2_hand_imu_v1.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d045a378d1238fdc25a6172158ec161acb158e6c53189c29afcb0b27c489737 +size 292237 diff --git a/configs/ordering/wisdm_watch_accel_v1.csv.gz b/configs/ordering/wisdm_watch_accel_v1.csv.gz new file mode 100644 index 0000000000000000000000000000000000000000..d1a972d2ae9adb90362f715d94a2d192c11ff10e --- /dev/null +++ b/configs/ordering/wisdm_watch_accel_v1.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8dc0113ae3c5114fabed5dfc38b9c44c2c057f5ad37094cd2b312f731ee05249 +size 2891909 diff --git a/models/wisp_evolution/capture24_wearable_activity_v1/fold0/seed42/model.pkl b/models/wisp_evolution/capture24_wearable_activity_v1/fold0/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..465df37e6af3b782d945c1dbfb88ab707eea684c --- /dev/null +++ b/models/wisp_evolution/capture24_wearable_activity_v1/fold0/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:efa2e8604213ef4989368eedc7e077746724d0e45eba640c93ed8a6df76b2bad +size 128855 diff --git a/models/wisp_evolution/capture24_wearable_activity_v1/fold0/seed43/model.pkl b/models/wisp_evolution/capture24_wearable_activity_v1/fold0/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..b0ea4c262e0c232c8d2cb16b6fb4e955db0fcdb3 --- /dev/null +++ b/models/wisp_evolution/capture24_wearable_activity_v1/fold0/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:feac6c70266738be626a463ec0bd7deb778bdd63e4acaaa0027692959aec4598 +size 64391 diff --git a/models/wisp_evolution/capture24_wearable_activity_v1/fold0/seed44/model.pkl b/models/wisp_evolution/capture24_wearable_activity_v1/fold0/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..b6f7ba2a4e8bfbbbdd6bb9b385551a35aeb04030 --- /dev/null +++ b/models/wisp_evolution/capture24_wearable_activity_v1/fold0/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc5accae13589359550c006de9301f3c37970d3332cdb9edfa166cb28b8491fa +size 64845 diff --git a/models/wisp_evolution/capture24_wearable_activity_v1/fold1/seed42/model.pkl b/models/wisp_evolution/capture24_wearable_activity_v1/fold1/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..5b798e1693d740bb2561e514310816f6e4e0f013 --- /dev/null +++ b/models/wisp_evolution/capture24_wearable_activity_v1/fold1/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b55ea01da5f0a0d1832836c99428f6ae17ebfc6c18101aad6633fbc89d0a8c6 +size 347933090 diff --git a/models/wisp_evolution/capture24_wearable_activity_v1/fold1/seed43/model.pkl b/models/wisp_evolution/capture24_wearable_activity_v1/fold1/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..491d80cc63cf0013b5947063129833a7cb8efbd8 --- /dev/null +++ b/models/wisp_evolution/capture24_wearable_activity_v1/fold1/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1f9521a70baff07ae0e2705279c268dae32f3bf01088791a01b740a2d0eee7b +size 130511 diff --git a/models/wisp_evolution/capture24_wearable_activity_v1/fold1/seed44/model.pkl b/models/wisp_evolution/capture24_wearable_activity_v1/fold1/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..2479d69e9cfca74e877470dcaab5ee1d8ca12c6a --- /dev/null +++ b/models/wisp_evolution/capture24_wearable_activity_v1/fold1/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c77d246c5eec2ee3c943bbc43e366ebedfb234cfe3c19dbd2341daafec7efffa +size 592029080 diff --git a/models/wisp_evolution/capture24_wearable_activity_v1/fold2/seed42/model.pkl b/models/wisp_evolution/capture24_wearable_activity_v1/fold2/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..96653f128eb3102922c52e4393604b8910895382 --- /dev/null +++ b/models/wisp_evolution/capture24_wearable_activity_v1/fold2/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48284dba20870ad2877b9189df3bec278653f04c8a3c99812f0840188a0d657e +size 130236 diff --git a/models/wisp_evolution/capture24_wearable_activity_v1/fold2/seed43/model.pkl b/models/wisp_evolution/capture24_wearable_activity_v1/fold2/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..c8ce7ae6cc40a03f6788b30b84c2392af1902df6 --- /dev/null +++ b/models/wisp_evolution/capture24_wearable_activity_v1/fold2/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c3152512aed2c8bbb1c16efd7942035151f9e89e139a58c8abfc2f9158470b2 +size 64221 diff --git a/models/wisp_evolution/capture24_wearable_activity_v1/fold2/seed44/model.pkl b/models/wisp_evolution/capture24_wearable_activity_v1/fold2/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..f8afcbe91660ce4e20de86fca54c49cd3d8bf409 --- /dev/null +++ b/models/wisp_evolution/capture24_wearable_activity_v1/fold2/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66e2b8cd1c80f44d36e2ff62422ad6509515f99359a52b0fc62b543192605664 +size 128604 diff --git a/models/wisp_evolution/capture24_wearable_activity_v1/fold3/seed42/model.pkl b/models/wisp_evolution/capture24_wearable_activity_v1/fold3/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..2e7e8bd5922f132d94c74322620459e9855e3abc --- /dev/null +++ b/models/wisp_evolution/capture24_wearable_activity_v1/fold3/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e9ce884e630f754d915db2bf33fe41392c659e2fd04a569225695902c90db0f +size 127524 diff --git a/models/wisp_evolution/capture24_wearable_activity_v1/fold3/seed43/model.pkl b/models/wisp_evolution/capture24_wearable_activity_v1/fold3/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..02a2353063cfe3e8e59540f5be29d520ebafe407 --- /dev/null +++ b/models/wisp_evolution/capture24_wearable_activity_v1/fold3/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:966eab1af20383e4ba9a7aa3d014fe22d7dde2c1b34eb75681cb90563f999662 +size 164122 diff --git a/models/wisp_evolution/capture24_wearable_activity_v1/fold3/seed44/model.pkl b/models/wisp_evolution/capture24_wearable_activity_v1/fold3/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..92eac93bca5783fb91e0ef1c3180a5a12aa3d063 --- /dev/null +++ b/models/wisp_evolution/capture24_wearable_activity_v1/fold3/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34fddd3eed7a6389bf16550b29df02b8646dd08bd5a8961363070b236323a6af +size 175628 diff --git a/models/wisp_evolution/capture24_wearable_activity_v1/fold4/seed42/model.pkl b/models/wisp_evolution/capture24_wearable_activity_v1/fold4/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..fe0d9621b02fcaf787cbbf61e0fe597825063856 --- /dev/null +++ b/models/wisp_evolution/capture24_wearable_activity_v1/fold4/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ded22cb68e6229b81b7d16ca5c0edaa46e66099a10fbc5c90d8af138a92c99c +size 164896 diff --git a/models/wisp_evolution/capture24_wearable_activity_v1/fold4/seed43/model.pkl b/models/wisp_evolution/capture24_wearable_activity_v1/fold4/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..cb6839caa05563e2fb214094b6db6c7c0fe3418b --- /dev/null +++ b/models/wisp_evolution/capture24_wearable_activity_v1/fold4/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a888536d0d5f7dc270067e8ea39665c7cd4e1e29a331fa57600076b157985bab +size 161763 diff --git a/models/wisp_evolution/capture24_wearable_activity_v1/fold4/seed44/model.pkl b/models/wisp_evolution/capture24_wearable_activity_v1/fold4/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..673115d6f1a2f82dcd3a192a540949c9dbda9809 --- /dev/null +++ b/models/wisp_evolution/capture24_wearable_activity_v1/fold4/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e3ad341c1e95d21e5bcd9cd71ae1eda615c27c49f8d67c2bd75c563da10a1ac +size 133859 diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold0/seed42/checkpoint.json b/models/wisp_evolution/domino_watch_accel_v1/fold0/seed42/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..56a92629e4a02130bba0d021ef5ad9876d48b337 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold0/seed42/checkpoint.json @@ -0,0 +1,143 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "domino_watch_accel_v1", + "fold": 0, + "seed": 42, + "split_seed": 1000, + "fit_scope": "train+validation", + "input_shape": [ + 500, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 100.0, + "label_names": [ + "brushing_teeth", + "cycling", + "elevator_down", + "elevator_up", + "lying", + "moving_by_car", + "running", + "sitting", + "sitting_on_transport", + "stairs_down", + "stairs_up", + "standing", + "standing_on_transport", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 256, + "classifier": "ridge", + "use_hmm": true, + "seed": 100710, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "hmm", + "ridge" + ], + "route": "cpu", + "parent_id": "g003c0054_f47a19ece923", + "mutation": "change_classifier" + }, + "selected_candidate_id": "g011c0174_4e58b130c75c", + "paper_metrics": { + "macro_f1": 0.7664598552903535, + "accuracy": 0.9142131979695431, + "balanced_accuracy": 0.759350201817826, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "domino", + "source_name": "DOMINO", + "official_url": "https://doi.org/10.13130/RD_UNIMI/QECFKA", + "upstream_version": "3.2", + "license": "cc0-1.0", + "license_url": "https://creativecommons.org/publicdomain/zero/1.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.7664598552903535, + "accuracy": 0.9142131979695431, + "balanced_accuracy": 0.759350201817826, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "91782879414932f4fd1d83de2b64f157f80a4203e71dd9cebc63de3836655b2c", + "source_sha256": "91782879414932f4fd1d83de2b64f157f80a4203e71dd9cebc63de3836655b2c", + "bytes": 212600, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold0/seed42/model.pkl b/models/wisp_evolution/domino_watch_accel_v1/fold0/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..3a8b1c6ff5612f4e37513c81f456f3e32c5107b3 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold0/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91782879414932f4fd1d83de2b64f157f80a4203e71dd9cebc63de3836655b2c +size 212600 diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold0/seed43/checkpoint.json b/models/wisp_evolution/domino_watch_accel_v1/fold0/seed43/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..baab09d71a66492201f142ef2490ffe37a0fe3e5 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold0/seed43/checkpoint.json @@ -0,0 +1,143 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "domino_watch_accel_v1", + "fold": 0, + "seed": 43, + "split_seed": 1000, + "fit_scope": "train+validation", + "input_shape": [ + 500, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 100.0, + "label_names": [ + "brushing_teeth", + "cycling", + "elevator_down", + "elevator_up", + "lying", + "moving_by_car", + "running", + "sitting", + "sitting_on_transport", + "stairs_down", + "stairs_up", + "standing", + "standing_on_transport", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 128, + "classifier": "ridge", + "use_hmm": true, + "seed": 244163, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "hmm", + "ridge" + ], + "route": "cpu", + "parent_id": "g005c0086_3c718d665977", + "mutation": "change_segments" + }, + "selected_candidate_id": "g019c0303_15488d98d753", + "paper_metrics": { + "macro_f1": 0.7779119924157182, + "accuracy": 0.9030456852791878, + "balanced_accuracy": 0.771893748615854, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "domino", + "source_name": "DOMINO", + "official_url": "https://doi.org/10.13130/RD_UNIMI/QECFKA", + "upstream_version": "3.2", + "license": "cc0-1.0", + "license_url": "https://creativecommons.org/publicdomain/zero/1.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.7779119924157182, + "accuracy": 0.9030456852791878, + "balanced_accuracy": 0.771893748615854, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "f987480f734d991975f9214d65fb667624b757b644f4187dd9eb17b44236ff80", + "source_sha256": "f987480f734d991975f9214d65fb667624b757b644f4187dd9eb17b44236ff80", + "bytes": 109344, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold0/seed43/model.pkl b/models/wisp_evolution/domino_watch_accel_v1/fold0/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..03f19320ccb84fe5701cb0f67f436f207b5fcd75 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold0/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f987480f734d991975f9214d65fb667624b757b644f4187dd9eb17b44236ff80 +size 109344 diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold0/seed44/checkpoint.json b/models/wisp_evolution/domino_watch_accel_v1/fold0/seed44/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..06f809706678615701f63fdbfd83b81932f64fe6 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold0/seed44/checkpoint.json @@ -0,0 +1,143 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "domino_watch_accel_v1", + "fold": 0, + "seed": 44, + "split_seed": 1000, + "fit_scope": "train+validation", + "input_shape": [ + 500, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 100.0, + "label_names": [ + "brushing_teeth", + "cycling", + "elevator_down", + "elevator_up", + "lying", + "moving_by_car", + "running", + "sitting", + "sitting_on_transport", + "stairs_down", + "stairs_up", + "standing", + "standing_on_transport", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 256, + "classifier": "ridge", + "use_hmm": true, + "seed": 180002, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "hmm", + "ridge" + ], + "route": "cpu", + "parent_id": "g004c0067_7f69e56e003c", + "mutation": "change_symbolic_bins" + }, + "selected_candidate_id": "g012c0188_083f974c4e8f", + "paper_metrics": { + "macro_f1": 0.7588925510712723, + "accuracy": 0.9055837563451776, + "balanced_accuracy": 0.7528336709974588, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "domino", + "source_name": "DOMINO", + "official_url": "https://doi.org/10.13130/RD_UNIMI/QECFKA", + "upstream_version": "3.2", + "license": "cc0-1.0", + "license_url": "https://creativecommons.org/publicdomain/zero/1.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.7588925510712723, + "accuracy": 0.9055837563451776, + "balanced_accuracy": 0.7528336709974588, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "dc05c3132f80de17ce71294cf01693bac44d720b3374913fabdf232c8c762ba9", + "source_sha256": "dc05c3132f80de17ce71294cf01693bac44d720b3374913fabdf232c8c762ba9", + "bytes": 215498, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold0/seed44/model.pkl b/models/wisp_evolution/domino_watch_accel_v1/fold0/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..5ad42d1229c7399777f62e9896f8577fcfe0b099 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold0/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc05c3132f80de17ce71294cf01693bac44d720b3374913fabdf232c8c762ba9 +size 215498 diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold1/seed42/checkpoint.json b/models/wisp_evolution/domino_watch_accel_v1/fold1/seed42/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..85007939146702048cf5944ec50eb1248c86393b --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold1/seed42/checkpoint.json @@ -0,0 +1,147 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "domino_watch_accel_v1", + "fold": 1, + "seed": 42, + "split_seed": 2000, + "fit_scope": "train+validation", + "input_shape": [ + 500, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 100.0, + "label_names": [ + "brushing_teeth", + "cycling", + "elevator_down", + "elevator_up", + "lying", + "moving_by_car", + "running", + "sitting", + "sitting_on_transport", + "stairs_down", + "stairs_up", + "standing", + "standing_on_transport", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "state_rocket_interval_hmm", + "params": { + "n_kernels": 384, + "n_intervals": 24, + "classifier": "ridge", + "use_hmm": true, + "seed": 19460, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_pool", + "dyadic_intervals", + "quantile_distribution", + "symbolic_transition", + "ridge", + "hmm" + ], + "route": "cpu", + "parent_id": "g002c0025_709f1d97d21f", + "mutation": "insert_state_motif" + }, + "selected_candidate_id": "g003c0042_6b24d0c72d9b", + "paper_metrics": { + "macro_f1": 0.7654332232404667, + "accuracy": 0.8809418036428254, + "balanced_accuracy": 0.7650026167595115, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "domino", + "source_name": "DOMINO", + "official_url": "https://doi.org/10.13130/RD_UNIMI/QECFKA", + "upstream_version": "3.2", + "license": "cc0-1.0", + "license_url": "https://creativecommons.org/publicdomain/zero/1.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.7654332232404667, + "accuracy": 0.8809418036428254, + "balanced_accuracy": 0.7650026167595115, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "cf2712de8548876ab47ead3c76641d2aff86285a081d09d3e3e1a1fee26bcd7b", + "source_sha256": "cf2712de8548876ab47ead3c76641d2aff86285a081d09d3e3e1a1fee26bcd7b", + "bytes": 539572, + "copy_action": "copied", + "loaded_model_class": "StateRocketIntervalHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold1/seed42/model.pkl b/models/wisp_evolution/domino_watch_accel_v1/fold1/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..f559f8ee97736f6993623358df624e35fd252df4 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold1/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf2712de8548876ab47ead3c76641d2aff86285a081d09d3e3e1a1fee26bcd7b +size 539572 diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold1/seed43/checkpoint.json b/models/wisp_evolution/domino_watch_accel_v1/fold1/seed43/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..8e3416abe68f7ef1285c5491ab0c0bba12aea813 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold1/seed43/checkpoint.json @@ -0,0 +1,143 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "domino_watch_accel_v1", + "fold": 1, + "seed": 43, + "split_seed": 2000, + "fit_scope": "train+validation", + "input_shape": [ + 500, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 100.0, + "label_names": [ + "brushing_teeth", + "cycling", + "elevator_down", + "elevator_up", + "lying", + "moving_by_car", + "running", + "sitting", + "sitting_on_transport", + "stairs_down", + "stairs_up", + "standing", + "standing_on_transport", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 384, + "classifier": "logreg", + "use_hmm": true, + "seed": 161957, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "hmm", + "logreg" + ], + "route": "cpu", + "parent_id": "g008c0124_92391b33f0bf", + "mutation": "change_classifier" + }, + "selected_candidate_id": "g010c0156_9f93a6332116", + "paper_metrics": { + "macro_f1": 0.7475567873753366, + "accuracy": 0.8431808085295425, + "balanced_accuracy": 0.7409736397320528, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "domino", + "source_name": "DOMINO", + "official_url": "https://doi.org/10.13130/RD_UNIMI/QECFKA", + "upstream_version": "3.2", + "license": "cc0-1.0", + "license_url": "https://creativecommons.org/publicdomain/zero/1.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.7475567873753366, + "accuracy": 0.8431808085295425, + "balanced_accuracy": 0.7409736397320528, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "f207d6cb99c6be9e0229de253aeb5c554106e6808b8630e28c87738f9f7582b3", + "source_sha256": "f207d6cb99c6be9e0229de253aeb5c554106e6808b8630e28c87738f9f7582b3", + "bytes": 318789, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold1/seed43/model.pkl b/models/wisp_evolution/domino_watch_accel_v1/fold1/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..115156c56ec207828861162287f251472cc53ec4 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold1/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f207d6cb99c6be9e0229de253aeb5c554106e6808b8630e28c87738f9f7582b3 +size 318789 diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold1/seed44/checkpoint.json b/models/wisp_evolution/domino_watch_accel_v1/fold1/seed44/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..7c892bcd35bd9f1ad9fafa83b1154d0fcf9bcc3f --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold1/seed44/checkpoint.json @@ -0,0 +1,143 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "domino_watch_accel_v1", + "fold": 1, + "seed": 44, + "split_seed": 2000, + "fit_scope": "train+validation", + "input_shape": [ + 500, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 100.0, + "label_names": [ + "brushing_teeth", + "cycling", + "elevator_down", + "elevator_up", + "lying", + "moving_by_car", + "running", + "sitting", + "sitting_on_transport", + "stairs_down", + "stairs_up", + "standing", + "standing_on_transport", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 256, + "classifier": "ridge", + "use_hmm": true, + "seed": 194395, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "hmm", + "ridge" + ], + "route": "cpu", + "parent_id": "g004c0064_df620e86ae5d", + "mutation": "change_symbolic_bins" + }, + "selected_candidate_id": "g012c0186_0a703cc00653", + "paper_metrics": { + "macro_f1": 0.7643324610484091, + "accuracy": 0.8698356286095069, + "balanced_accuracy": 0.7816075184988293, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "domino", + "source_name": "DOMINO", + "official_url": "https://doi.org/10.13130/RD_UNIMI/QECFKA", + "upstream_version": "3.2", + "license": "cc0-1.0", + "license_url": "https://creativecommons.org/publicdomain/zero/1.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.7643324610484091, + "accuracy": 0.8698356286095069, + "balanced_accuracy": 0.7816075184988293, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "2bbd335eeb771d9febd05165213d6c533578169d0a8d57b0127a817714d12005", + "source_sha256": "2bbd335eeb771d9febd05165213d6c533578169d0a8d57b0127a817714d12005", + "bytes": 216225, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold1/seed44/model.pkl b/models/wisp_evolution/domino_watch_accel_v1/fold1/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..f6288d023c6a45e108da9d736f3c4b6219480eec --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold1/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bbd335eeb771d9febd05165213d6c533578169d0a8d57b0127a817714d12005 +size 216225 diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold2/seed42/checkpoint.json b/models/wisp_evolution/domino_watch_accel_v1/fold2/seed42/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..ad3c9040124227cd958abf84f35d6f97e0731bd1 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold2/seed42/checkpoint.json @@ -0,0 +1,147 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "domino_watch_accel_v1", + "fold": 2, + "seed": 42, + "split_seed": 3000, + "fit_scope": "train+validation", + "input_shape": [ + 500, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 100.0, + "label_names": [ + "brushing_teeth", + "cycling", + "elevator_down", + "elevator_up", + "lying", + "moving_by_car", + "running", + "sitting", + "sitting_on_transport", + "stairs_down", + "stairs_up", + "standing", + "standing_on_transport", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "state_rocket_interval_hmm", + "params": { + "n_kernels": 384, + "n_intervals": 24, + "classifier": "ridge", + "use_hmm": true, + "seed": 177555, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_pool", + "dyadic_intervals", + "quantile_distribution", + "symbolic_transition", + "hmm", + "ridge" + ], + "route": "cpu", + "parent_id": "g005c0083_0dfe9f6c191e", + "mutation": "change_classifier" + }, + "selected_candidate_id": "g008c0131_c369776e43d7", + "paper_metrics": { + "macro_f1": 0.6063961064701442, + "accuracy": 0.8345864661654135, + "balanced_accuracy": 0.6476178172323037, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "domino", + "source_name": "DOMINO", + "official_url": "https://doi.org/10.13130/RD_UNIMI/QECFKA", + "upstream_version": "3.2", + "license": "cc0-1.0", + "license_url": "https://creativecommons.org/publicdomain/zero/1.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.6063961064701442, + "accuracy": 0.8345864661654135, + "balanced_accuracy": 0.6476178172323037, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "c250dac4028d1978b59d5ccb9dfc9881c040b1623291d93d23e68351b1e10a6a", + "source_sha256": "c250dac4028d1978b59d5ccb9dfc9881c040b1623291d93d23e68351b1e10a6a", + "bytes": 542893, + "copy_action": "copied", + "loaded_model_class": "StateRocketIntervalHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold2/seed42/model.pkl b/models/wisp_evolution/domino_watch_accel_v1/fold2/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..0cb02991bdc6b63733a7c8086269ad9134fd27ff --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold2/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c250dac4028d1978b59d5ccb9dfc9881c040b1623291d93d23e68351b1e10a6a +size 542893 diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold2/seed43/checkpoint.json b/models/wisp_evolution/domino_watch_accel_v1/fold2/seed43/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..f9bb05cc602d356443e0b73b7533df21a38bffa9 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold2/seed43/checkpoint.json @@ -0,0 +1,147 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "domino_watch_accel_v1", + "fold": 2, + "seed": 43, + "split_seed": 3000, + "fit_scope": "train+validation", + "input_shape": [ + 500, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 100.0, + "label_names": [ + "brushing_teeth", + "cycling", + "elevator_down", + "elevator_up", + "lying", + "moving_by_car", + "running", + "sitting", + "sitting_on_transport", + "stairs_down", + "stairs_up", + "standing", + "standing_on_transport", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "state_rocket_interval_hmm", + "params": { + "n_kernels": 384, + "n_intervals": 24, + "classifier": "ridge", + "use_hmm": true, + "seed": 95616, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_pool", + "dyadic_intervals", + "quantile_distribution", + "symbolic_transition", + "ridge", + "hmm" + ], + "route": "cpu", + "parent_id": "g005c0080_45f50cb4db75", + "mutation": "insert_state_motif" + }, + "selected_candidate_id": "g009c0144_496b27072c67", + "paper_metrics": { + "macro_f1": 0.6786222922383697, + "accuracy": 0.8883747831116252, + "balanced_accuracy": 0.7045844794521647, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "domino", + "source_name": "DOMINO", + "official_url": "https://doi.org/10.13130/RD_UNIMI/QECFKA", + "upstream_version": "3.2", + "license": "cc0-1.0", + "license_url": "https://creativecommons.org/publicdomain/zero/1.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.6786222922383697, + "accuracy": 0.8883747831116252, + "balanced_accuracy": 0.7045844794521647, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "c780ed09a5710ffeda2ecaf05f41dbdc62d24781faba84ac4d25c6c3f06098a2", + "source_sha256": "c780ed09a5710ffeda2ecaf05f41dbdc62d24781faba84ac4d25c6c3f06098a2", + "bytes": 540198, + "copy_action": "copied", + "loaded_model_class": "StateRocketIntervalHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold2/seed43/model.pkl b/models/wisp_evolution/domino_watch_accel_v1/fold2/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..c68b5a2af2926dbc1c4dd6dc6f1057f096d990ba --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold2/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c780ed09a5710ffeda2ecaf05f41dbdc62d24781faba84ac4d25c6c3f06098a2 +size 540198 diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold2/seed44/checkpoint.json b/models/wisp_evolution/domino_watch_accel_v1/fold2/seed44/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..69ba35b8833403bfdbb8145b95ce71b16db37d53 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold2/seed44/checkpoint.json @@ -0,0 +1,147 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "domino_watch_accel_v1", + "fold": 2, + "seed": 44, + "split_seed": 3000, + "fit_scope": "train+validation", + "input_shape": [ + 500, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 100.0, + "label_names": [ + "brushing_teeth", + "cycling", + "elevator_down", + "elevator_up", + "lying", + "moving_by_car", + "running", + "sitting", + "sitting_on_transport", + "stairs_down", + "stairs_up", + "standing", + "standing_on_transport", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "state_rocket_interval_hmm", + "params": { + "n_kernels": 384, + "n_intervals": 24, + "classifier": "ridge", + "use_hmm": true, + "seed": 27803, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_pool", + "dyadic_intervals", + "quantile_distribution", + "symbolic_transition", + "ridge", + "hmm" + ], + "route": "cpu", + "parent_id": "g002c0039_1877d1e4cf39", + "mutation": "insert_state_motif" + }, + "selected_candidate_id": "g005c0085_97c64b96ecc4", + "paper_metrics": { + "macro_f1": 0.6059659135596054, + "accuracy": 0.8340080971659919, + "balanced_accuracy": 0.6479127025827084, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "domino", + "source_name": "DOMINO", + "official_url": "https://doi.org/10.13130/RD_UNIMI/QECFKA", + "upstream_version": "3.2", + "license": "cc0-1.0", + "license_url": "https://creativecommons.org/publicdomain/zero/1.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.6059659135596054, + "accuracy": 0.8340080971659919, + "balanced_accuracy": 0.6479127025827084, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "ad2ecac326b372c3dde4f10e2b6079b0eed91a7cd39fe073aec238131c0dc91f", + "source_sha256": "ad2ecac326b372c3dde4f10e2b6079b0eed91a7cd39fe073aec238131c0dc91f", + "bytes": 542016, + "copy_action": "copied", + "loaded_model_class": "StateRocketIntervalHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold2/seed44/model.pkl b/models/wisp_evolution/domino_watch_accel_v1/fold2/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..ab9bd66840921d0c03ac8e108e024383a6e5dfcc --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold2/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad2ecac326b372c3dde4f10e2b6079b0eed91a7cd39fe073aec238131c0dc91f +size 542016 diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold3/seed42/checkpoint.json b/models/wisp_evolution/domino_watch_accel_v1/fold3/seed42/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..ac04114c7563f5a99b1d9b8af1d327a7e6bf4794 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold3/seed42/checkpoint.json @@ -0,0 +1,143 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "domino_watch_accel_v1", + "fold": 3, + "seed": 42, + "split_seed": 4000, + "fit_scope": "train+validation", + "input_shape": [ + 500, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 100.0, + "label_names": [ + "brushing_teeth", + "cycling", + "elevator_down", + "elevator_up", + "lying", + "moving_by_car", + "running", + "sitting", + "sitting_on_transport", + "stairs_down", + "stairs_up", + "standing", + "standing_on_transport", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 256, + "classifier": "logreg", + "use_hmm": true, + "seed": 190046, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "hmm", + "logreg" + ], + "route": "cpu", + "parent_id": "g011c0181_959b8b1e618d", + "mutation": "change_symbolic_bins" + }, + "selected_candidate_id": "g017c0279_fe554edbd3e2", + "paper_metrics": { + "macro_f1": 0.6328932422472617, + "accuracy": 0.8124012638230648, + "balanced_accuracy": 0.658274984974044, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "domino", + "source_name": "DOMINO", + "official_url": "https://doi.org/10.13130/RD_UNIMI/QECFKA", + "upstream_version": "3.2", + "license": "cc0-1.0", + "license_url": "https://creativecommons.org/publicdomain/zero/1.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.6328932422472617, + "accuracy": 0.8124012638230648, + "balanced_accuracy": 0.658274984974044, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "e00af7926b2d0764a2ee380dab3e15d8608f58be432b0441448491310da1bff0", + "source_sha256": "e00af7926b2d0764a2ee380dab3e15d8608f58be432b0441448491310da1bff0", + "bytes": 212454, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold3/seed42/model.pkl b/models/wisp_evolution/domino_watch_accel_v1/fold3/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..ed8a286ea1f148540ce227aeb401a67b0135ec58 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold3/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e00af7926b2d0764a2ee380dab3e15d8608f58be432b0441448491310da1bff0 +size 212454 diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold3/seed43/checkpoint.json b/models/wisp_evolution/domino_watch_accel_v1/fold3/seed43/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..79c401af96cf9dea837bc1da865705aa1bdbb6fc --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold3/seed43/checkpoint.json @@ -0,0 +1,143 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "domino_watch_accel_v1", + "fold": 3, + "seed": 43, + "split_seed": 4000, + "fit_scope": "train+validation", + "input_shape": [ + 500, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 100.0, + "label_names": [ + "brushing_teeth", + "cycling", + "elevator_down", + "elevator_up", + "lying", + "moving_by_car", + "running", + "sitting", + "sitting_on_transport", + "stairs_down", + "stairs_up", + "standing", + "standing_on_transport", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 256, + "classifier": "logreg", + "use_hmm": true, + "seed": 117740, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "hmm", + "logreg" + ], + "route": "cpu", + "parent_id": "g014c0219_c61b761d5bc7", + "mutation": "change_classifier" + }, + "selected_candidate_id": "g017c0271_60601ba7fc9a", + "paper_metrics": { + "macro_f1": 0.5656274211024497, + "accuracy": 0.7918641390205371, + "balanced_accuracy": 0.5810575952113626, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "domino", + "source_name": "DOMINO", + "official_url": "https://doi.org/10.13130/RD_UNIMI/QECFKA", + "upstream_version": "3.2", + "license": "cc0-1.0", + "license_url": "https://creativecommons.org/publicdomain/zero/1.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.5656274211024497, + "accuracy": 0.7918641390205371, + "balanced_accuracy": 0.5810575952113626, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "e9d96df627dad5f8005a5dde54b70ae26ec7fcc47b7571fe2b429156d40a72bc", + "source_sha256": "e9d96df627dad5f8005a5dde54b70ae26ec7fcc47b7571fe2b429156d40a72bc", + "bytes": 215087, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold3/seed43/model.pkl b/models/wisp_evolution/domino_watch_accel_v1/fold3/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..a47227d66601ebd3b0964a32529a2f9659eb003f --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold3/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9d96df627dad5f8005a5dde54b70ae26ec7fcc47b7571fe2b429156d40a72bc +size 215087 diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold3/seed44/checkpoint.json b/models/wisp_evolution/domino_watch_accel_v1/fold3/seed44/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..5c683dae5566e2256d689bb9864e07494e19a077 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold3/seed44/checkpoint.json @@ -0,0 +1,143 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "domino_watch_accel_v1", + "fold": 3, + "seed": 44, + "split_seed": 4000, + "fit_scope": "train+validation", + "input_shape": [ + 500, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 100.0, + "label_names": [ + "brushing_teeth", + "cycling", + "elevator_down", + "elevator_up", + "lying", + "moving_by_car", + "running", + "sitting", + "sitting_on_transport", + "stairs_down", + "stairs_up", + "standing", + "standing_on_transport", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 256, + "classifier": "logreg", + "use_hmm": true, + "seed": 148711, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "hmm", + "logreg" + ], + "route": "cpu", + "parent_id": "g016c0257_ce54884418d4", + "mutation": "change_symbolic_bins" + }, + "selected_candidate_id": "g018c0289_e805a7522152", + "paper_metrics": { + "macro_f1": 0.5766493081312468, + "accuracy": 0.7969984202211691, + "balanced_accuracy": 0.5883944723651199, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "domino", + "source_name": "DOMINO", + "official_url": "https://doi.org/10.13130/RD_UNIMI/QECFKA", + "upstream_version": "3.2", + "license": "cc0-1.0", + "license_url": "https://creativecommons.org/publicdomain/zero/1.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.5766493081312468, + "accuracy": 0.7969984202211691, + "balanced_accuracy": 0.5883944723651199, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "cabbe2a146876bdf4d60ef3b7511d624112af70f087adaf6362efc6d24842f1f", + "source_sha256": "cabbe2a146876bdf4d60ef3b7511d624112af70f087adaf6362efc6d24842f1f", + "bytes": 213083, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold3/seed44/model.pkl b/models/wisp_evolution/domino_watch_accel_v1/fold3/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..b13b9d511661c4945c7d12cc719fc8c080c95395 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold3/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cabbe2a146876bdf4d60ef3b7511d624112af70f087adaf6362efc6d24842f1f +size 213083 diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold4/seed42/checkpoint.json b/models/wisp_evolution/domino_watch_accel_v1/fold4/seed42/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..999ff6a9b410bffd29bfb5ea9779024ba26e3e0f --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold4/seed42/checkpoint.json @@ -0,0 +1,143 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "domino_watch_accel_v1", + "fold": 4, + "seed": 42, + "split_seed": 5000, + "fit_scope": "train+validation", + "input_shape": [ + 500, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 100.0, + "label_names": [ + "brushing_teeth", + "cycling", + "elevator_down", + "elevator_up", + "lying", + "moving_by_car", + "running", + "sitting", + "sitting_on_transport", + "stairs_down", + "stairs_up", + "standing", + "standing_on_transport", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 384, + "classifier": "ridge", + "use_hmm": true, + "seed": 160913, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "ridge", + "hmm" + ], + "route": "cpu", + "parent_id": "g004c0065_7aa3402ae2a0", + "mutation": "change_rocket_kernels" + }, + "selected_candidate_id": "g018c0290_fc813f6000fd", + "paper_metrics": { + "macro_f1": 0.6476508962514093, + "accuracy": 0.8443037974683544, + "balanced_accuracy": 0.6502484226519598, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "domino", + "source_name": "DOMINO", + "official_url": "https://doi.org/10.13130/RD_UNIMI/QECFKA", + "upstream_version": "3.2", + "license": "cc0-1.0", + "license_url": "https://creativecommons.org/publicdomain/zero/1.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.6476508962514093, + "accuracy": 0.8443037974683544, + "balanced_accuracy": 0.6502484226519598, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "7f022f0cb93b1f3d1b3333bc9280f649705c197ede1e8c632a915c4648190fcc", + "source_sha256": "7f022f0cb93b1f3d1b3333bc9280f649705c197ede1e8c632a915c4648190fcc", + "bytes": 319198, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold4/seed42/model.pkl b/models/wisp_evolution/domino_watch_accel_v1/fold4/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..229fc19f21092029082df6d42189c3a32e961a3f --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold4/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f022f0cb93b1f3d1b3333bc9280f649705c197ede1e8c632a915c4648190fcc +size 319198 diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold4/seed43/checkpoint.json b/models/wisp_evolution/domino_watch_accel_v1/fold4/seed43/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..ceace5c5226e99a4d4f9166a4eaee3e89b598098 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold4/seed43/checkpoint.json @@ -0,0 +1,147 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "domino_watch_accel_v1", + "fold": 4, + "seed": 43, + "split_seed": 5000, + "fit_scope": "train+validation", + "input_shape": [ + 500, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 100.0, + "label_names": [ + "brushing_teeth", + "cycling", + "elevator_down", + "elevator_up", + "lying", + "moving_by_car", + "running", + "sitting", + "sitting_on_transport", + "stairs_down", + "stairs_up", + "standing", + "standing_on_transport", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "state_rocket_interval_hmm", + "params": { + "n_kernels": 384, + "n_intervals": 24, + "classifier": "ridge", + "use_hmm": true, + "seed": 105826, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_pool", + "dyadic_intervals", + "quantile_distribution", + "symbolic_transition", + "ridge", + "hmm" + ], + "route": "cpu", + "parent_id": "g010c0162_041d0a3e7601", + "mutation": "insert_state_motif" + }, + "selected_candidate_id": "g014c0219_8856d1d106e8", + "paper_metrics": { + "macro_f1": 0.618716820825527, + "accuracy": 0.8510548523206751, + "balanced_accuracy": 0.6259556576317066, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "domino", + "source_name": "DOMINO", + "official_url": "https://doi.org/10.13130/RD_UNIMI/QECFKA", + "upstream_version": "3.2", + "license": "cc0-1.0", + "license_url": "https://creativecommons.org/publicdomain/zero/1.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.618716820825527, + "accuracy": 0.8510548523206751, + "balanced_accuracy": 0.6259556576317066, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "e6cb7ff7b7eabaeebceb94181be0b077fc467ab9693a583392ee8e5eb829a29b", + "source_sha256": "e6cb7ff7b7eabaeebceb94181be0b077fc467ab9693a583392ee8e5eb829a29b", + "bytes": 541362, + "copy_action": "copied", + "loaded_model_class": "StateRocketIntervalHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold4/seed43/model.pkl b/models/wisp_evolution/domino_watch_accel_v1/fold4/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..fbbb3603dde80b363c0261b769d44be7feb99509 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold4/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6cb7ff7b7eabaeebceb94181be0b077fc467ab9693a583392ee8e5eb829a29b +size 541362 diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold4/seed44/checkpoint.json b/models/wisp_evolution/domino_watch_accel_v1/fold4/seed44/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..9b6c792a02f68c548a17008657d91ead833b75a6 --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold4/seed44/checkpoint.json @@ -0,0 +1,143 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "domino_watch_accel_v1", + "fold": 4, + "seed": 44, + "split_seed": 5000, + "fit_scope": "train+validation", + "input_shape": [ + 500, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 100.0, + "label_names": [ + "brushing_teeth", + "cycling", + "elevator_down", + "elevator_up", + "lying", + "moving_by_car", + "running", + "sitting", + "sitting_on_transport", + "stairs_down", + "stairs_up", + "standing", + "standing_on_transport", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 256, + "classifier": "ridge", + "use_hmm": true, + "seed": 157332, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "ridge", + "hmm" + ], + "route": "cpu", + "parent_id": "g004c0058_ba2571b7117a", + "mutation": "change_rocket_kernels" + }, + "selected_candidate_id": "g010c0167_34b52b14268e", + "paper_metrics": { + "macro_f1": 0.6790563959748898, + "accuracy": 0.8611814345991561, + "balanced_accuracy": 0.6645928651150633, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "domino", + "source_name": "DOMINO", + "official_url": "https://doi.org/10.13130/RD_UNIMI/QECFKA", + "upstream_version": "3.2", + "license": "cc0-1.0", + "license_url": "https://creativecommons.org/publicdomain/zero/1.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.6790563959748898, + "accuracy": 0.8611814345991561, + "balanced_accuracy": 0.6645928651150633, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "913f6893df2fc3e36e06434f73869862a53c966f78f3011f0906c81900623bf7", + "source_sha256": "913f6893df2fc3e36e06434f73869862a53c966f78f3011f0906c81900623bf7", + "bytes": 210604, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/domino_watch_accel_v1/fold4/seed44/model.pkl b/models/wisp_evolution/domino_watch_accel_v1/fold4/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..162b307fa84115aadd7a06388b498ffd9868eaee --- /dev/null +++ b/models/wisp_evolution/domino_watch_accel_v1/fold4/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:913f6893df2fc3e36e06434f73869862a53c966f78f3011f0906c81900623bf7 +size 210604 diff --git a/models/wisp_evolution/handy_wrist_accel_v1/fold0/seed42/model.pkl b/models/wisp_evolution/handy_wrist_accel_v1/fold0/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..e81d19cbfbcf281e1ca84d3293b40ead78dbf58c --- /dev/null +++ b/models/wisp_evolution/handy_wrist_accel_v1/fold0/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ba2051deeb8953941a5ba1097cf67c02bae3e0400ac3ba552d5ba6d92e523fd +size 107027779 diff --git a/models/wisp_evolution/handy_wrist_accel_v1/fold1/seed42/model.pkl b/models/wisp_evolution/handy_wrist_accel_v1/fold1/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..e0c1d3d904ea6d142b0b45db5cbe8ca9959db43e --- /dev/null +++ b/models/wisp_evolution/handy_wrist_accel_v1/fold1/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e92e2c69e08c43c5b43a1ee7424453a0c6efcece3d351138a1ecd40cde17b434 +size 108937791 diff --git a/models/wisp_evolution/handy_wrist_accel_v1/fold1/seed43/model.pkl b/models/wisp_evolution/handy_wrist_accel_v1/fold1/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..c8bfec6e82dd754136d445ded5433e2fa4919b7b --- /dev/null +++ b/models/wisp_evolution/handy_wrist_accel_v1/fold1/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a0ec2e26f0c92f0a9bee79d4d16c82361fb07bad0e8ba3f6cf78873284fbbff +size 69160983 diff --git a/models/wisp_evolution/handy_wrist_accel_v1/fold1/seed44/model.pkl b/models/wisp_evolution/handy_wrist_accel_v1/fold1/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..4aa039c7653e529ae1afa720421b9b01d3735e4c --- /dev/null +++ b/models/wisp_evolution/handy_wrist_accel_v1/fold1/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49db770dfcc481f405a102acfe78a27064e9424221313042063188f1a8a2ad48 +size 69220315 diff --git a/models/wisp_evolution/handy_wrist_accel_v1/fold2/seed42/model.pkl b/models/wisp_evolution/handy_wrist_accel_v1/fold2/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..0feda4780a1e5ee681a785715d0b87f7d281a6a1 --- /dev/null +++ b/models/wisp_evolution/handy_wrist_accel_v1/fold2/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6111562ba3832d7c834a167ef77c6f8639fe1d979d35017ebbaf8bdede9c839f +size 70056227 diff --git a/models/wisp_evolution/handy_wrist_accel_v1/fold2/seed43/model.pkl b/models/wisp_evolution/handy_wrist_accel_v1/fold2/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..ac935b1a33fad04e3160c2ce9bc39400e78bb2de --- /dev/null +++ b/models/wisp_evolution/handy_wrist_accel_v1/fold2/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7741bfa8ce2e05112fac9f950e9075a2973e9a81f0ada3d9e676ebc487ae4d7d +size 30878124 diff --git a/models/wisp_evolution/handy_wrist_accel_v1/fold2/seed44/model.pkl b/models/wisp_evolution/handy_wrist_accel_v1/fold2/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..ada937502dc446df526f2482abc97722be8db19b --- /dev/null +++ b/models/wisp_evolution/handy_wrist_accel_v1/fold2/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f3ae2ef84aa939b59d3b1ef0d07f5bc5e4b87b5fe487f86bd013733f9daf6ad +size 30208604 diff --git a/models/wisp_evolution/handy_wrist_accel_v1/fold3/seed42/model.pkl b/models/wisp_evolution/handy_wrist_accel_v1/fold3/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..471b7e4bc7a53af8eb2ed473fc11e7fae0955929 --- /dev/null +++ b/models/wisp_evolution/handy_wrist_accel_v1/fold3/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22e3d999f78b0ea25cf621e6b0e2233717892e85c2fe821b120231da482b9dd6 +size 29162012 diff --git a/models/wisp_evolution/handy_wrist_accel_v1/fold3/seed43/model.pkl b/models/wisp_evolution/handy_wrist_accel_v1/fold3/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..4ec7a81b0a9cda760d84c7ee20d8e06c3f2e3807 --- /dev/null +++ b/models/wisp_evolution/handy_wrist_accel_v1/fold3/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:edf212eef5bab87a08152d61291dc7ef0e01114f220d4e372ba4d42b06af6242 +size 67966647 diff --git a/models/wisp_evolution/handy_wrist_accel_v1/fold3/seed44/model.pkl b/models/wisp_evolution/handy_wrist_accel_v1/fold3/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..1607880d8d18e573ecb8cf4187f092290aecf7c6 --- /dev/null +++ b/models/wisp_evolution/handy_wrist_accel_v1/fold3/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6777cd4ce496465a3deb12a74d58cabfdc498145ce3485b9b09b3688ee09aea5 +size 68830105 diff --git a/models/wisp_evolution/handy_wrist_accel_v1/fold4/seed42/model.pkl b/models/wisp_evolution/handy_wrist_accel_v1/fold4/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..6e92e9afd2601dd9391847bdf265c036d527308b --- /dev/null +++ b/models/wisp_evolution/handy_wrist_accel_v1/fold4/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3772a56d9802e1201b220323acfab33e90e13c7c1e5fdd315fef49329842bac4 +size 29370288 diff --git a/models/wisp_evolution/handy_wrist_accel_v1/fold4/seed43/model.pkl b/models/wisp_evolution/handy_wrist_accel_v1/fold4/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..bb1cd173bd116cf20d3e67509a5d4b9fe08d39eb --- /dev/null +++ b/models/wisp_evolution/handy_wrist_accel_v1/fold4/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79b0bbd8d789f273915019109e1c79b4012e400ce4336b80a8b2de213b376acf +size 29652538 diff --git a/models/wisp_evolution/handy_wrist_accel_v1/fold4/seed44/model.pkl b/models/wisp_evolution/handy_wrist_accel_v1/fold4/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..29a9fcdca14686b83c4d396a4a476566de1e3ab0 --- /dev/null +++ b/models/wisp_evolution/handy_wrist_accel_v1/fold4/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:448bed549863e5f10d2843e937a4c4c3fd282cd15171c5f20e4970facf451d81 +size 109540579 diff --git a/models/wisp_evolution/harmes_left_wrist_accel_v1/fold0/seed42/model.pkl b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold0/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..ed279b1ee93f4ce7912ec2c0bb5132a021652c37 --- /dev/null +++ b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold0/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:036a2ff2ca69e09e785fcf0b0ad2b7cd5b2c14996b915a4840c17eb4e98f44d7 +size 812416 diff --git a/models/wisp_evolution/harmes_left_wrist_accel_v1/fold0/seed43/model.pkl b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold0/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..b2d2468b20d493178dca649346cfa5552e67cd19 --- /dev/null +++ b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold0/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54c708e15be4215fa32d885d85257bd09be95e83ec0beb097a7eb4ff74944b40 +size 586110 diff --git a/models/wisp_evolution/harmes_left_wrist_accel_v1/fold0/seed44/model.pkl b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold0/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..49d43833624671ae8add11d67087b552b19edba1 --- /dev/null +++ b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold0/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6a53d74eabde5c5dfe0f9c1be47bfe0d641ecddde0739efda79fc92933aae38 +size 702211 diff --git a/models/wisp_evolution/harmes_left_wrist_accel_v1/fold1/seed42/model.pkl b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold1/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..1a7ad19711e6ee1c7fd4761fede5c610af9eb328 --- /dev/null +++ b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold1/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0cbcab1b6bd4e29ba9d1d1532339c60ceda1eb623ff8b635de0d7a2058f9fd57 +size 366487 diff --git a/models/wisp_evolution/harmes_left_wrist_accel_v1/fold1/seed43/model.pkl b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold1/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..9bc8ee722c72c1d2a16e4c1bb0cf9bd36671f9ac --- /dev/null +++ b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold1/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f30f5071527b5e6a91313eece5fd547570f5b23f7859d6feb5a9adb21bed997 +size 479767 diff --git a/models/wisp_evolution/harmes_left_wrist_accel_v1/fold1/seed44/model.pkl b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold1/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..ea64d6766fa5aeae304b65cdf1ff72a604e89ebe --- /dev/null +++ b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold1/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3316aff7e86d626e671de4aeb0b58720856bfee06b6b5bebe482193ca7e62cd4 +size 589671 diff --git a/models/wisp_evolution/harmes_left_wrist_accel_v1/fold2/seed42/model.pkl b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold2/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..f0c09db854920d83defa70bcec409eb54c6f71f8 --- /dev/null +++ b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold2/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c33c1d7f183f138b4d34ac5927b9156a7fd20c731affa8c8165db2239189b3ed +size 856939 diff --git a/models/wisp_evolution/harmes_left_wrist_accel_v1/fold2/seed43/model.pkl b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold2/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..f6f00914050df39b9ad279017f616bcf72a1f7c3 --- /dev/null +++ b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold2/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06f7274c1dafdffdd23e29988cef74286bacfd6ec13b28f4ed2f677f8361a04b +size 591055 diff --git a/models/wisp_evolution/harmes_left_wrist_accel_v1/fold2/seed44/model.pkl b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold2/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..edf2d1a7feea43a71cd88ad1910160063b92fdd4 --- /dev/null +++ b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold2/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bde21d7f651fc6c81a941892af381009a94022df1980f1e9a01ed5b6018dae5a +size 678051 diff --git a/models/wisp_evolution/harmes_left_wrist_accel_v1/fold3/seed42/model.pkl b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold3/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..bb9c36444a7090ebe286202fbda2d40fa7f4998f --- /dev/null +++ b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold3/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3faa0b76c9aba0701a6cdb52920174ae1521ea97aa2a3f64821dfe08d997ae6 +size 856835 diff --git a/models/wisp_evolution/harmes_left_wrist_accel_v1/fold3/seed43/model.pkl b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold3/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..719e46580535bb66e39b15d76143ee83f48d1222 --- /dev/null +++ b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold3/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d435fe4444ee31e12f4aeff2d08da4da90b1581e55789f78c53b63e459cbda72 +size 555115 diff --git a/models/wisp_evolution/harmes_left_wrist_accel_v1/fold3/seed44/model.pkl b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold3/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..ff63b6f21e3e02d9aed268e7ec3dce07fb0f35c1 --- /dev/null +++ b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold3/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63f4c3fc491c715125760737b25c16405481f68eaefd3945ce31338650723c6e +size 678876 diff --git a/models/wisp_evolution/harmes_left_wrist_accel_v1/fold4/seed42/model.pkl b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold4/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..a440342d4b1e83344f0038e34d5ad76439ba9f7f --- /dev/null +++ b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold4/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bea2ddaf698e130e949026e1d06658401971805e9a3192abd36778e73b885c37 +size 164963 diff --git a/models/wisp_evolution/harmes_left_wrist_accel_v1/fold4/seed43/model.pkl b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold4/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..3a27430511c395b75f6dbe26d53ab15cc85b3699 --- /dev/null +++ b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold4/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa9923bc96f898e37075dc1fe779e76b14f44e27caf6deda4068d31d0c756f62 +size 587574 diff --git a/models/wisp_evolution/harmes_left_wrist_accel_v1/fold4/seed44/model.pkl b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold4/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..aba7073fd3649402719244959e2995164c3fd93f --- /dev/null +++ b/models/wisp_evolution/harmes_left_wrist_accel_v1/fold4/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ed51ab0acde02f67a2049d119fc0a1d83ea9cdebf3833321f09c7ec12c487f1 +size 589309 diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed42/checkpoint.json b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed42/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..4f6429f1cc9600d47e6ba83e9ee0d2d537ea89fb --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed42/checkpoint.json @@ -0,0 +1,147 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "harmes_right_wrist_accel_v1", + "fold": 0, + "seed": 42, + "split_seed": 1000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "Brushing teeth", + "Cleaning out the dishwasher", + "Cleaning table", + "Cream hands", + "Cutting vegetables", + "Disinfecting hands", + "Drinking", + "Floor cleaning", + "Making tea", + "Null", + "Putting away the dishes", + "Vacuum Cleaning", + "Washing dishes", + "Washing hands", + "Watering plant", + "Window cleaning" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "mutation": "change_segments", + "name": "rocket_sketch_ridge_hmm", + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "argmax", + "ridge" + ], + "params": { + "classifier": "ridge", + "n_jobs": 1, + "n_kernels": 768, + "seed": 156641, + "use_hmm": false + }, + "parent_id": "g014c0224_cb348ddc5b5f", + "route": "cpu" + }, + "selected_candidate_id": "g017c0270_6e41f1d86df0", + "paper_metrics": { + "macro_f1": 0.4770637820616741, + "accuracy": 0.5076923076923077, + "balanced_accuracy": 0.5092512560398281, + "worst_class_f1": 0.1962864721485411 + }, + "raw_historical_metric_deltas": { + "macro_f1": 5.551115123125783e-17, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "harmes", + "source_name": "HARMES", + "official_url": "https://zenodo.org/records/19425719", + "upstream_version": "Zenodo record 19425719", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 5.551115123125783e-17, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.47706378206167416, + "accuracy": 0.5076923076923077, + "balanced_accuracy": 0.5092512560398281, + "worst_class_f1": 0.1962864721485411 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "b45b73fd069a7912e03d1855f10a92784abbc3953e9651cee273a6532f692464", + "source_sha256": "b45b73fd069a7912e03d1855f10a92784abbc3953e9651cee273a6532f692464", + "bytes": 681220, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": false, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed42/model.pkl b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..059c4d0b55617adb36e4d1af5b528d52945d05bb --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b45b73fd069a7912e03d1855f10a92784abbc3953e9651cee273a6532f692464 +size 681220 diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed43/checkpoint.json b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed43/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..5d55ef8cc1704feaed01cd91efad495e6256cb49 --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed43/checkpoint.json @@ -0,0 +1,151 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "harmes_right_wrist_accel_v1", + "fold": 0, + "seed": 43, + "split_seed": 1000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "Brushing teeth", + "Cleaning out the dishwasher", + "Cleaning table", + "Cream hands", + "Cutting vegetables", + "Disinfecting hands", + "Drinking", + "Floor cleaning", + "Making tea", + "Null", + "Putting away the dishes", + "Vacuum Cleaning", + "Washing dishes", + "Washing hands", + "Watering plant", + "Window cleaning" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "state_rocket_interval_hmm", + "params": { + "n_kernels": 384, + "n_intervals": 16, + "classifier": "ridge", + "use_hmm": false, + "seed": 202110, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_pool", + "dyadic_intervals", + "quantile_distribution", + "symbolic_transition", + "ridge", + "argmax" + ], + "route": "cpu", + "parent_id": "g004c0061_8da6da2dfa3f", + "mutation": "change_intervals" + }, + "selected_candidate_id": "g007c0111_1ef76b9ef96a", + "paper_metrics": { + "macro_f1": 0.4931284403851084, + "accuracy": 0.5299145299145299, + "balanced_accuracy": 0.5207230526700427, + "worst_class_f1": 0.1807909604519774 + }, + "raw_historical_metric_deltas": { + "macro_f1": 5.551115123125783e-17, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "harmes", + "source_name": "HARMES", + "official_url": "https://zenodo.org/records/19425719", + "upstream_version": "Zenodo record 19425719", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 5.551115123125783e-17, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.49312844038510845, + "accuracy": 0.5299145299145299, + "balanced_accuracy": 0.5207230526700427, + "worst_class_f1": 0.1807909604519774 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "0752056393d300870f405f1eaa6c1ea04582279181d1e136badfa8ce80222518", + "source_sha256": "0752056393d300870f405f1eaa6c1ea04582279181d1e136badfa8ce80222518", + "bytes": 554213, + "copy_action": "copied", + "loaded_model_class": "StateRocketIntervalHMM", + "uses_sequence_decoder": false, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed43/model.pkl b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..223e773467c997e46922f0139cfcf50075eb9e9f --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0752056393d300870f405f1eaa6c1ea04582279181d1e136badfa8ce80222518 +size 554213 diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed44/checkpoint.json b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed44/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..30490a90ad394f05601778e753bd2821a2aea4bd --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed44/checkpoint.json @@ -0,0 +1,147 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "harmes_right_wrist_accel_v1", + "fold": 0, + "seed": 44, + "split_seed": 1000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "Brushing teeth", + "Cleaning out the dishwasher", + "Cleaning table", + "Cream hands", + "Cutting vegetables", + "Disinfecting hands", + "Drinking", + "Floor cleaning", + "Making tea", + "Null", + "Putting away the dishes", + "Vacuum Cleaning", + "Washing dishes", + "Washing hands", + "Watering plant", + "Window cleaning" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 384, + "classifier": "ridge", + "use_hmm": false, + "seed": 164275, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "argmax", + "ridge" + ], + "route": "cpu", + "parent_id": "g006c0101_37e077997af2", + "mutation": "change_symbolic_bins" + }, + "selected_candidate_id": "g019c0303_7b94807d9bf4", + "paper_metrics": { + "macro_f1": 0.4666524181153792, + "accuracy": 0.5035897435897436, + "balanced_accuracy": 0.4970196630822971, + "worst_class_f1": 0.1602209944751381 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 5.551115123125783e-17, + "worst_class_f1": 2.7755575615628914e-17 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "harmes", + "source_name": "HARMES", + "official_url": "https://zenodo.org/records/19425719", + "upstream_version": "Zenodo record 19425719", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 5.551115123125783e-17, + "worst_class_f1": 2.7755575615628914e-17 + }, + "metrics": { + "macro_f1": 0.4666524181153792, + "accuracy": 0.5035897435897436, + "balanced_accuracy": 0.49701966308229717, + "worst_class_f1": 0.16022099447513813 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "a58060dc11572fe3ccdce4a6d2f0150fcbdf558914403de04c4b8d2f11cfc7ae", + "source_sha256": "a58060dc11572fe3ccdce4a6d2f0150fcbdf558914403de04c4b8d2f11cfc7ae", + "bytes": 344185, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": false, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed44/model.pkl b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..0afaec666337b67d3eeebf57e077968ce4bb65b1 --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold0/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a58060dc11572fe3ccdce4a6d2f0150fcbdf558914403de04c4b8d2f11cfc7ae +size 344185 diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed42/checkpoint.json b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed42/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..61cf2d2537b37f93557f235949f7d47222054e44 --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed42/checkpoint.json @@ -0,0 +1,151 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "harmes_right_wrist_accel_v1", + "fold": 1, + "seed": 42, + "split_seed": 2000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "Brushing teeth", + "Cleaning out the dishwasher", + "Cleaning table", + "Cream hands", + "Cutting vegetables", + "Disinfecting hands", + "Drinking", + "Floor cleaning", + "Making tea", + "Null", + "Putting away the dishes", + "Vacuum Cleaning", + "Washing dishes", + "Washing hands", + "Watering plant", + "Window cleaning" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "state_rocket_interval_hmm", + "params": { + "n_kernels": 128, + "n_intervals": 24, + "classifier": "ridge", + "use_hmm": false, + "seed": 216132, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_pool", + "dyadic_intervals", + "quantile_distribution", + "symbolic_transition", + "ridge", + "argmax" + ], + "route": "cpu", + "parent_id": "g007c0112_5c70fdd7ea83", + "mutation": "change_rocket_kernels" + }, + "selected_candidate_id": "g020c0316_0adaf5914a05", + "paper_metrics": { + "macro_f1": 0.4370155710734781, + "accuracy": 0.4697265625, + "balanced_accuracy": 0.4801136866848379, + "worst_class_f1": 0.1203585147247119 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 5.551115123125783e-17, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "harmes", + "source_name": "HARMES", + "official_url": "https://zenodo.org/records/19425719", + "upstream_version": "Zenodo record 19425719", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 5.551115123125783e-17, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.4370155710734781, + "accuracy": 0.4697265625, + "balanced_accuracy": 0.48011368668483795, + "worst_class_f1": 0.1203585147247119 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "70840706528cb04f82ac77a1d4c92016dc45ee93a2f96c56a01f09966d31b925", + "source_sha256": "70840706528cb04f82ac77a1d4c92016dc45ee93a2f96c56a01f09966d31b925", + "bytes": 364507, + "copy_action": "copied", + "loaded_model_class": "StateRocketIntervalHMM", + "uses_sequence_decoder": false, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed42/model.pkl b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..52cb8626b0e7e05a14c7f09b47624bd18035ccc3 --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70840706528cb04f82ac77a1d4c92016dc45ee93a2f96c56a01f09966d31b925 +size 364507 diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed43/checkpoint.json b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed43/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..3c10f06cd3e9a581cb435ecb0d83df732e76d83d --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed43/checkpoint.json @@ -0,0 +1,151 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "harmes_right_wrist_accel_v1", + "fold": 1, + "seed": 43, + "split_seed": 2000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "Brushing teeth", + "Cleaning out the dishwasher", + "Cleaning table", + "Cream hands", + "Cutting vegetables", + "Disinfecting hands", + "Drinking", + "Floor cleaning", + "Making tea", + "Null", + "Putting away the dishes", + "Vacuum Cleaning", + "Washing dishes", + "Washing hands", + "Watering plant", + "Window cleaning" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "state_rocket_interval_hmm", + "params": { + "n_kernels": 384, + "n_intervals": 48, + "classifier": "ridge", + "use_hmm": false, + "seed": 275744, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_pool", + "dyadic_intervals", + "quantile_distribution", + "symbolic_transition", + "ridge", + "argmax" + ], + "route": "cpu", + "parent_id": "g008c0127_2f5deeb33a15", + "mutation": "change_intervals" + }, + "selected_candidate_id": "g012c0191_8c0594b3e115", + "paper_metrics": { + "macro_f1": 0.4512327358194982, + "accuracy": 0.4790581597222222, + "balanced_accuracy": 0.4927504657871251, + "worst_class_f1": 0.1793478260869565 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 5.551115123125783e-17, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "harmes", + "source_name": "HARMES", + "official_url": "https://zenodo.org/records/19425719", + "upstream_version": "Zenodo record 19425719", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 5.551115123125783e-17, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.4512327358194982, + "accuracy": 0.4790581597222222, + "balanced_accuracy": 0.49275046578712517, + "worst_class_f1": 0.1793478260869565 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "5bb2a4d812e31bc98fcc59fb93920ddf01a1167ee426e56150098a931c74aba4", + "source_sha256": "5bb2a4d812e31bc98fcc59fb93920ddf01a1167ee426e56150098a931c74aba4", + "bytes": 697475, + "copy_action": "copied", + "loaded_model_class": "StateRocketIntervalHMM", + "uses_sequence_decoder": false, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed43/model.pkl b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..fa2c1c53c67fc7fcfe75750b692e2eadf8426f2b --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5bb2a4d812e31bc98fcc59fb93920ddf01a1167ee426e56150098a931c74aba4 +size 697475 diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed44/checkpoint.json b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed44/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..4f6499bcd4d6164c07331f000f22e37f461d8d26 --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed44/checkpoint.json @@ -0,0 +1,147 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "harmes_right_wrist_accel_v1", + "fold": 1, + "seed": 44, + "split_seed": 2000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "Brushing teeth", + "Cleaning out the dishwasher", + "Cleaning table", + "Cream hands", + "Cutting vegetables", + "Disinfecting hands", + "Drinking", + "Floor cleaning", + "Making tea", + "Null", + "Putting away the dishes", + "Vacuum Cleaning", + "Washing dishes", + "Washing hands", + "Watering plant", + "Window cleaning" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 512, + "classifier": "ridge", + "use_hmm": false, + "seed": 207730, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "argmax", + "ridge" + ], + "route": "cpu", + "parent_id": "g005c0085_2a93ba10cb5c", + "mutation": "change_symbolic_bins" + }, + "selected_candidate_id": "g016c0258_89cb062bba96", + "paper_metrics": { + "macro_f1": 0.4471513148059462, + "accuracy": 0.4729817708333333, + "balanced_accuracy": 0.4896130334214386, + "worst_class_f1": 0.1707317073170731 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 5.551115123125783e-17, + "worst_class_f1": 8.326672684688674e-17 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "harmes", + "source_name": "HARMES", + "official_url": "https://zenodo.org/records/19425719", + "upstream_version": "Zenodo record 19425719", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 5.551115123125783e-17, + "worst_class_f1": 8.326672684688674e-17 + }, + "metrics": { + "macro_f1": 0.4471513148059462, + "accuracy": 0.4729817708333333, + "balanced_accuracy": 0.48961303342143864, + "worst_class_f1": 0.17073170731707318 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "89fd62d69fb8334e6474dd91d725669067166c5e62c3178ea6068d6478bfd641", + "source_sha256": "89fd62d69fb8334e6474dd91d725669067166c5e62c3178ea6068d6478bfd641", + "bytes": 451638, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": false, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed44/model.pkl b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..b11ec832bf6cf841029e5b3dde5dc7a09451c712 --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold1/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89fd62d69fb8334e6474dd91d725669067166c5e62c3178ea6068d6478bfd641 +size 451638 diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed42/checkpoint.json b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed42/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..59924dca1fed5a0e82a04222d7f9b568ca52a0ed --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed42/checkpoint.json @@ -0,0 +1,151 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "harmes_right_wrist_accel_v1", + "fold": 2, + "seed": 42, + "split_seed": 3000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "Brushing teeth", + "Cleaning out the dishwasher", + "Cleaning table", + "Cream hands", + "Cutting vegetables", + "Disinfecting hands", + "Drinking", + "Floor cleaning", + "Making tea", + "Null", + "Putting away the dishes", + "Vacuum Cleaning", + "Washing dishes", + "Washing hands", + "Watering plant", + "Window cleaning" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "state_rocket_interval_hmm", + "params": { + "n_kernels": 256, + "n_intervals": 24, + "classifier": "ridge", + "use_hmm": false, + "seed": 168671, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_pool", + "dyadic_intervals", + "quantile_distribution", + "symbolic_transition", + "ridge", + "argmax" + ], + "route": "cpu", + "parent_id": "g005c0075_083c6df617df", + "mutation": "change_rocket_kernels" + }, + "selected_candidate_id": "g014c0231_faf90b813ed5", + "paper_metrics": { + "macro_f1": 0.5345935850365053, + "accuracy": 0.58274231678487, + "balanced_accuracy": 0.5655624417274536, + "worst_class_f1": 0.2165605095541401 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 2.7755575615628914e-17 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "harmes", + "source_name": "HARMES", + "official_url": "https://zenodo.org/records/19425719", + "upstream_version": "Zenodo record 19425719", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 2.7755575615628914e-17 + }, + "metrics": { + "macro_f1": 0.5345935850365053, + "accuracy": 0.58274231678487, + "balanced_accuracy": 0.5655624417274536, + "worst_class_f1": 0.21656050955414013 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "ba5cf262812bbe919af9e320dbc6d871a6ea1cd10c91c3aa70e16e6d79de8da5", + "source_sha256": "ba5cf262812bbe919af9e320dbc6d871a6ea1cd10c91c3aa70e16e6d79de8da5", + "bytes": 477487, + "copy_action": "copied", + "loaded_model_class": "StateRocketIntervalHMM", + "uses_sequence_decoder": false, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed42/model.pkl b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..4656d0b34c33aa5c22fab1f5ec40b07bee3d839e --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba5cf262812bbe919af9e320dbc6d871a6ea1cd10c91c3aa70e16e6d79de8da5 +size 477487 diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed43/checkpoint.json b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed43/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..3ccc4c90e007a4c0cb033e49944ed375aaa76d4f --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed43/checkpoint.json @@ -0,0 +1,151 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "harmes_right_wrist_accel_v1", + "fold": 2, + "seed": 43, + "split_seed": 3000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "Brushing teeth", + "Cleaning out the dishwasher", + "Cleaning table", + "Cream hands", + "Cutting vegetables", + "Disinfecting hands", + "Drinking", + "Floor cleaning", + "Making tea", + "Null", + "Putting away the dishes", + "Vacuum Cleaning", + "Washing dishes", + "Washing hands", + "Watering plant", + "Window cleaning" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "state_rocket_interval_hmm", + "params": { + "n_kernels": 512, + "n_intervals": 24, + "classifier": "ridge", + "use_hmm": false, + "seed": 173196, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_pool", + "dyadic_intervals", + "quantile_distribution", + "symbolic_transition", + "ridge", + "argmax" + ], + "route": "cpu", + "parent_id": "g004c0072_4ee73c818b91", + "mutation": "change_rocket_kernels" + }, + "selected_candidate_id": "g015c0240_5084a179da22", + "paper_metrics": { + "macro_f1": 0.5360904467830878, + "accuracy": 0.5872340425531914, + "balanced_accuracy": 0.5652497977212918, + "worst_class_f1": 0.1818181818181818 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 2.7755575615628914e-17 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "harmes", + "source_name": "HARMES", + "official_url": "https://zenodo.org/records/19425719", + "upstream_version": "Zenodo record 19425719", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 2.7755575615628914e-17 + }, + "metrics": { + "macro_f1": 0.5360904467830878, + "accuracy": 0.5872340425531914, + "balanced_accuracy": 0.5652497977212918, + "worst_class_f1": 0.18181818181818182 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "c9b0240e9e9b1e24a6818aea545aca798ed834851723fe5cbc1cf6bee074c309", + "source_sha256": "c9b0240e9e9b1e24a6818aea545aca798ed834851723fe5cbc1cf6bee074c309", + "bytes": 701127, + "copy_action": "copied", + "loaded_model_class": "StateRocketIntervalHMM", + "uses_sequence_decoder": false, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed43/model.pkl b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..b3a6282845543be78ea125c597cfc01179e757b0 --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9b0240e9e9b1e24a6818aea545aca798ed834851723fe5cbc1cf6bee074c309 +size 701127 diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed44/checkpoint.json b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed44/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..382ec5f4e97a2157fbab84b43d86eebe49f2f5e2 --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed44/checkpoint.json @@ -0,0 +1,151 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "harmes_right_wrist_accel_v1", + "fold": 2, + "seed": 44, + "split_seed": 3000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "Brushing teeth", + "Cleaning out the dishwasher", + "Cleaning table", + "Cream hands", + "Cutting vegetables", + "Disinfecting hands", + "Drinking", + "Floor cleaning", + "Making tea", + "Null", + "Putting away the dishes", + "Vacuum Cleaning", + "Washing dishes", + "Washing hands", + "Watering plant", + "Window cleaning" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "state_rocket_interval_hmm", + "params": { + "n_kernels": 384, + "n_intervals": 24, + "classifier": "ridge", + "use_hmm": false, + "seed": 250930, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_pool", + "dyadic_intervals", + "quantile_distribution", + "symbolic_transition", + "argmax", + "ridge" + ], + "route": "cpu", + "parent_id": "g006c0098_456ff217f273", + "mutation": "change_symbolic_bins" + }, + "selected_candidate_id": "g014c0219_8bf2d624be94", + "paper_metrics": { + "macro_f1": 0.540710085532877, + "accuracy": 0.5888888888888889, + "balanced_accuracy": 0.5713526491135847, + "worst_class_f1": 0.2018348623853211 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "harmes", + "source_name": "HARMES", + "official_url": "https://zenodo.org/records/19425719", + "upstream_version": "Zenodo record 19425719", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.540710085532877, + "accuracy": 0.5888888888888889, + "balanced_accuracy": 0.5713526491135847, + "worst_class_f1": 0.2018348623853211 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "777bc6f479fcba72984e9e1aed22661d6ac8fc65036a2d58606ec75a7df3ae22", + "source_sha256": "777bc6f479fcba72984e9e1aed22661d6ac8fc65036a2d58606ec75a7df3ae22", + "bytes": 593415, + "copy_action": "copied", + "loaded_model_class": "StateRocketIntervalHMM", + "uses_sequence_decoder": false, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed44/model.pkl b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..fd1dbb4ef314facfc136ea70fcaffdbac2222f5b --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold2/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:777bc6f479fcba72984e9e1aed22661d6ac8fc65036a2d58606ec75a7df3ae22 +size 593415 diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed42/checkpoint.json b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed42/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..b9f6a1937c90e3508b4d3f86aac53a6bbf0e68b7 --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed42/checkpoint.json @@ -0,0 +1,151 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "harmes_right_wrist_accel_v1", + "fold": 3, + "seed": 42, + "split_seed": 4000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "Brushing teeth", + "Cleaning out the dishwasher", + "Cleaning table", + "Cream hands", + "Cutting vegetables", + "Disinfecting hands", + "Drinking", + "Floor cleaning", + "Making tea", + "Null", + "Putting away the dishes", + "Vacuum Cleaning", + "Washing dishes", + "Washing hands", + "Watering plant", + "Window cleaning" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "state_rocket_interval_hmm", + "params": { + "n_kernels": 768, + "n_intervals": 24, + "classifier": "ridge", + "use_hmm": false, + "seed": 234370, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_pool", + "dyadic_intervals", + "quantile_distribution", + "symbolic_transition", + "argmax", + "ridge" + ], + "route": "cpu", + "parent_id": "g017c0275_4308d2291630", + "mutation": "change_classifier" + }, + "selected_candidate_id": "g019c0311_ba9cc2828d2c", + "paper_metrics": { + "macro_f1": 0.5292660108853414, + "accuracy": 0.5708679076026015, + "balanced_accuracy": 0.5517760462043491, + "worst_class_f1": 0.2462311557788944 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 8.326672684688674e-17 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "harmes", + "source_name": "HARMES", + "official_url": "https://zenodo.org/records/19425719", + "upstream_version": "Zenodo record 19425719", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 8.326672684688674e-17 + }, + "metrics": { + "macro_f1": 0.5292660108853414, + "accuracy": 0.5708679076026015, + "balanced_accuracy": 0.5517760462043491, + "worst_class_f1": 0.24623115577889448 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "f6cb6f46235235f76ebec4dcaab5d78ef7b237742ceb943f4c0c956f71c6fe40", + "source_sha256": "f6cb6f46235235f76ebec4dcaab5d78ef7b237742ceb943f4c0c956f71c6fe40", + "bytes": 928585, + "copy_action": "copied", + "loaded_model_class": "StateRocketIntervalHMM", + "uses_sequence_decoder": false, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed42/model.pkl b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..bc987e299d843791f4cb4aca32cccd32afbd617f --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6cb6f46235235f76ebec4dcaab5d78ef7b237742ceb943f4c0c956f71c6fe40 +size 928585 diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed43/checkpoint.json b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed43/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..334a8a9f10377529dc48abb7d9e7ea33379d6c3f --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed43/checkpoint.json @@ -0,0 +1,151 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "harmes_right_wrist_accel_v1", + "fold": 3, + "seed": 43, + "split_seed": 4000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "Brushing teeth", + "Cleaning out the dishwasher", + "Cleaning table", + "Cream hands", + "Cutting vegetables", + "Disinfecting hands", + "Drinking", + "Floor cleaning", + "Making tea", + "Null", + "Putting away the dishes", + "Vacuum Cleaning", + "Washing dishes", + "Washing hands", + "Watering plant", + "Window cleaning" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "state_rocket_interval_hmm", + "params": { + "n_kernels": 768, + "n_intervals": 24, + "classifier": "ridge", + "use_hmm": false, + "seed": 167837, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_pool", + "dyadic_intervals", + "quantile_distribution", + "symbolic_transition", + "ridge", + "argmax" + ], + "route": "cpu", + "parent_id": "g001c0020_f0157e8a3159", + "mutation": "change_rocket_kernels" + }, + "selected_candidate_id": "g006c0095_d9b95f79b5ef", + "paper_metrics": { + "macro_f1": 0.5224325352669028, + "accuracy": 0.5642520744561561, + "balanced_accuracy": 0.5433392429912146, + "worst_class_f1": 0.224 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "harmes", + "source_name": "HARMES", + "official_url": "https://zenodo.org/records/19425719", + "upstream_version": "Zenodo record 19425719", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.5224325352669028, + "accuracy": 0.5642520744561561, + "balanced_accuracy": 0.5433392429912146, + "worst_class_f1": 0.224 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "2df7e442bc4600f05e8c723f33877fb92f60d551306cd69ff7175049bf7c43e4", + "source_sha256": "2df7e442bc4600f05e8c723f33877fb92f60d551306cd69ff7175049bf7c43e4", + "bytes": 920365, + "copy_action": "copied", + "loaded_model_class": "StateRocketIntervalHMM", + "uses_sequence_decoder": false, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed43/model.pkl b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..548ebf195a9ff1ec753129d255373bcf8d0e09e4 --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2df7e442bc4600f05e8c723f33877fb92f60d551306cd69ff7175049bf7c43e4 +size 920365 diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed44/checkpoint.json b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed44/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..ca322cad4564a292cf3f0af6dcd21c0df2f1f96a --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed44/checkpoint.json @@ -0,0 +1,147 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "harmes_right_wrist_accel_v1", + "fold": 3, + "seed": 44, + "split_seed": 4000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "Brushing teeth", + "Cleaning out the dishwasher", + "Cleaning table", + "Cream hands", + "Cutting vegetables", + "Disinfecting hands", + "Drinking", + "Floor cleaning", + "Making tea", + "Null", + "Putting away the dishes", + "Vacuum Cleaning", + "Washing dishes", + "Washing hands", + "Watering plant", + "Window cleaning" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 768, + "classifier": "ridge", + "use_hmm": false, + "seed": 156523, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "argmax", + "ridge" + ], + "route": "cpu", + "parent_id": "g006c0101_043414dabaac", + "mutation": "change_rocket_kernels" + }, + "selected_candidate_id": "g010c0162_fa6762575b29", + "paper_metrics": { + "macro_f1": 0.4902724278530045, + "accuracy": 0.5289302534200493, + "balanced_accuracy": 0.5163140375736235, + "worst_class_f1": 0.2375690607734806 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 5.551115123125783e-17 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "harmes", + "source_name": "HARMES", + "official_url": "https://zenodo.org/records/19425719", + "upstream_version": "Zenodo record 19425719", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 5.551115123125783e-17 + }, + "metrics": { + "macro_f1": 0.4902724278530045, + "accuracy": 0.5289302534200493, + "balanced_accuracy": 0.5163140375736235, + "worst_class_f1": 0.23756906077348067 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "935dd179ad44b3b02aa5e8545f12db3b4099b241eb890ce780d3c323c5ac9664", + "source_sha256": "935dd179ad44b3b02aa5e8545f12db3b4099b241eb890ce780d3c323c5ac9664", + "bytes": 678702, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": false, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed44/model.pkl b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..0882f721e58ddc7fae39f253d12d8e0bd0644b93 --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold3/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:935dd179ad44b3b02aa5e8545f12db3b4099b241eb890ce780d3c323c5ac9664 +size 678702 diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed42/checkpoint.json b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed42/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..8840be7dd1f6736c60f87169ac1ac2b069ccb015 --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed42/checkpoint.json @@ -0,0 +1,147 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "harmes_right_wrist_accel_v1", + "fold": 4, + "seed": 42, + "split_seed": 5000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "Brushing teeth", + "Cleaning out the dishwasher", + "Cleaning table", + "Cream hands", + "Cutting vegetables", + "Disinfecting hands", + "Drinking", + "Floor cleaning", + "Making tea", + "Null", + "Putting away the dishes", + "Vacuum Cleaning", + "Washing dishes", + "Washing hands", + "Watering plant", + "Window cleaning" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 128, + "classifier": "logreg", + "use_hmm": true, + "seed": 104391, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "logreg", + "hmm" + ], + "route": "cpu", + "parent_id": "g007c0116_85410f827dcd", + "mutation": "change_segments" + }, + "selected_candidate_id": "g015c0241_f7e51a073b2b", + "paper_metrics": { + "macro_f1": 0.48107076640171, + "accuracy": 0.5211361366914457, + "balanced_accuracy": 0.4729720984140153, + "worst_class_f1": 0.2077562326869806 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 5.551115123125783e-17, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "harmes", + "source_name": "HARMES", + "official_url": "https://zenodo.org/records/19425719", + "upstream_version": "Zenodo record 19425719", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 5.551115123125783e-17, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.48107076640171, + "accuracy": 0.5211361366914457, + "balanced_accuracy": 0.47297209841401533, + "worst_class_f1": 0.2077562326869806 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "66385fc30b94f06aa0449ed217198ccc132752ce4dc4535b14f709b3d2f412f0", + "source_sha256": "66385fc30b94f06aa0449ed217198ccc132752ce4dc4535b14f709b3d2f412f0", + "bytes": 116863, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed42/model.pkl b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..93b718303ae25a00502d27cffb3c0e106f770c9c --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66385fc30b94f06aa0449ed217198ccc132752ce4dc4535b14f709b3d2f412f0 +size 116863 diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed43/checkpoint.json b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed43/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..1daafb88953113bd721e468c1b47db9cca52b816 --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed43/checkpoint.json @@ -0,0 +1,151 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "harmes_right_wrist_accel_v1", + "fold": 4, + "seed": 43, + "split_seed": 5000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "Brushing teeth", + "Cleaning out the dishwasher", + "Cleaning table", + "Cream hands", + "Cutting vegetables", + "Disinfecting hands", + "Drinking", + "Floor cleaning", + "Making tea", + "Null", + "Putting away the dishes", + "Vacuum Cleaning", + "Washing dishes", + "Washing hands", + "Watering plant", + "Window cleaning" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "state_rocket_interval_hmm", + "params": { + "n_kernels": 384, + "n_intervals": 24, + "classifier": "ridge", + "use_hmm": false, + "seed": 146235, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_pool", + "dyadic_intervals", + "quantile_distribution", + "symbolic_transition", + "ridge", + "argmax" + ], + "route": "cpu", + "parent_id": "g004c0058_4ce2dfeb92cd", + "mutation": "change_symbolic_bins" + }, + "selected_candidate_id": "g005c0082_d43a5d94c6b1", + "paper_metrics": { + "macro_f1": 0.5040897734143406, + "accuracy": 0.5419948962609564, + "balanced_accuracy": 0.5311132155244158, + "worst_class_f1": 0.2003034901365705 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 5.551115123125783e-17 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "harmes", + "source_name": "HARMES", + "official_url": "https://zenodo.org/records/19425719", + "upstream_version": "Zenodo record 19425719", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 5.551115123125783e-17 + }, + "metrics": { + "macro_f1": 0.5040897734143406, + "accuracy": 0.5419948962609564, + "balanced_accuracy": 0.5311132155244158, + "worst_class_f1": 0.20030349013657056 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "500ca32f859e3fcc82c2e63641bcf90b276c39ef76b25897c20105bd34b33b76", + "source_sha256": "500ca32f859e3fcc82c2e63641bcf90b276c39ef76b25897c20105bd34b33b76", + "bytes": 587010, + "copy_action": "copied", + "loaded_model_class": "StateRocketIntervalHMM", + "uses_sequence_decoder": false, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed43/model.pkl b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..9fd6dd741dfeef27ef3452d5ccd4c316f896db5a --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:500ca32f859e3fcc82c2e63641bcf90b276c39ef76b25897c20105bd34b33b76 +size 587010 diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed44/checkpoint.json b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed44/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..495c7486addd4c1d71053d07e80de7bb54b576a8 --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed44/checkpoint.json @@ -0,0 +1,147 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "harmes_right_wrist_accel_v1", + "fold": 4, + "seed": 44, + "split_seed": 5000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 3 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "Brushing teeth", + "Cleaning out the dishwasher", + "Cleaning table", + "Cream hands", + "Cutting vegetables", + "Disinfecting hands", + "Drinking", + "Floor cleaning", + "Making tea", + "Null", + "Putting away the dishes", + "Vacuum Cleaning", + "Washing dishes", + "Washing hands", + "Watering plant", + "Window cleaning" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 768, + "classifier": "ridge", + "use_hmm": false, + "seed": 217497, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "argmax", + "ridge" + ], + "route": "cpu", + "parent_id": "g005c0084_a597f7e3ce33", + "mutation": "change_rocket_kernels" + }, + "selected_candidate_id": "g006c0089_f5b1e5986e38", + "paper_metrics": { + "macro_f1": 0.4909284526341692, + "accuracy": 0.5254632197936314, + "balanced_accuracy": 0.520122834067514, + "worst_class_f1": 0.196078431372549 + }, + "raw_historical_metric_deltas": { + "macro_f1": 5.551115123125783e-17, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 2.7755575615628914e-17 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "harmes", + "source_name": "HARMES", + "official_url": "https://zenodo.org/records/19425719", + "upstream_version": "Zenodo record 19425719", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 5.551115123125783e-17, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 2.7755575615628914e-17 + }, + "metrics": { + "macro_f1": 0.49092845263416923, + "accuracy": 0.5254632197936314, + "balanced_accuracy": 0.520122834067514, + "worst_class_f1": 0.19607843137254902 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "32de18c5708819ab41108eb5d133a31cb1df50743b541d3e44ec033066f0c252", + "source_sha256": "32de18c5708819ab41108eb5d133a31cb1df50743b541d3e44ec033066f0c252", + "bytes": 678966, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": false, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed44/model.pkl b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..9a6f4ac888fa88a7e95d79f2ce6938e92c783c51 --- /dev/null +++ b/models/wisp_evolution/harmes_right_wrist_accel_v1/fold4/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32de18c5708819ab41108eb5d133a31cb1df50743b541d3e44ec033066f0c252 +size 678966 diff --git a/models/wisp_evolution/iuwds_wrist_accel_v1/fold0/seed42/model.pkl b/models/wisp_evolution/iuwds_wrist_accel_v1/fold0/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..f34bb5c35f6be9c2a6c1a822ab069ab9999131fd --- /dev/null +++ b/models/wisp_evolution/iuwds_wrist_accel_v1/fold0/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64fdaaef017498ecc7315aa50318895b526ece1f7ca5565d2852c8c94b6fdb7a +size 144553 diff --git a/models/wisp_evolution/iuwds_wrist_accel_v1/fold0/seed43/model.pkl b/models/wisp_evolution/iuwds_wrist_accel_v1/fold0/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..cae4c1ea8367c8e7370c94f6f2e2dfdbe98bc3f1 --- /dev/null +++ b/models/wisp_evolution/iuwds_wrist_accel_v1/fold0/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c743297bc7b09082982f875e32a2efb54f4f9ab3417e51248ca11c64c51198fb +size 194458 diff --git a/models/wisp_evolution/iuwds_wrist_accel_v1/fold0/seed44/model.pkl b/models/wisp_evolution/iuwds_wrist_accel_v1/fold0/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..7f63ba659b2eb4401f277ece6fcf6ba219548565 --- /dev/null +++ b/models/wisp_evolution/iuwds_wrist_accel_v1/fold0/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ab88443c7cb1bd1291caabd5f666cda2fc23b1f3a7f4f61b082131ba58e5b5f +size 341656 diff --git a/models/wisp_evolution/iuwds_wrist_accel_v1/fold1/seed42/model.pkl b/models/wisp_evolution/iuwds_wrist_accel_v1/fold1/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..47cf5141c23bb58da93691733af7032dc9d48064 --- /dev/null +++ b/models/wisp_evolution/iuwds_wrist_accel_v1/fold1/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2f6ac7eea957553f6812a95af8140f0b47ea32fc36a0a021b72e7b65b2c5ad4 +size 336594 diff --git a/models/wisp_evolution/iuwds_wrist_accel_v1/fold1/seed43/model.pkl b/models/wisp_evolution/iuwds_wrist_accel_v1/fold1/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..d03ba0471ceb835700c8e780deaa8da89d340359 --- /dev/null +++ b/models/wisp_evolution/iuwds_wrist_accel_v1/fold1/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32e9553c9d5a4159a79f670139ae0ce81021f2ffcc2c7691b0af3ae030e54425 +size 343025 diff --git a/models/wisp_evolution/iuwds_wrist_accel_v1/fold1/seed44/model.pkl b/models/wisp_evolution/iuwds_wrist_accel_v1/fold1/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..5fa9f9042c352a5988e9b0b06852e2cdfa8599a4 --- /dev/null +++ b/models/wisp_evolution/iuwds_wrist_accel_v1/fold1/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e901ee03a0b25696fd04c6454816ac40d9fd6a9c620b0aaad388f502b3061ce +size 341859 diff --git a/models/wisp_evolution/iuwds_wrist_accel_v1/fold2/seed42/model.pkl b/models/wisp_evolution/iuwds_wrist_accel_v1/fold2/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..5bdd2b89cfd2e46dddded5fd74b06f45d7c59969 --- /dev/null +++ b/models/wisp_evolution/iuwds_wrist_accel_v1/fold2/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:064ae588a90768eb6a818b751dad91f2a4bdc110ea0cc3b879d0655073fdfad1 +size 73411 diff --git a/models/wisp_evolution/iuwds_wrist_accel_v1/fold2/seed43/model.pkl b/models/wisp_evolution/iuwds_wrist_accel_v1/fold2/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..a89ddb9b3815a5e3785eadac292bf5456cc94d8e --- /dev/null +++ b/models/wisp_evolution/iuwds_wrist_accel_v1/fold2/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31dc121ea36092e092175c7e0e5407da27c8a1a661baa1a52a283e93892565a3 +size 147505 diff --git a/models/wisp_evolution/iuwds_wrist_accel_v1/fold2/seed44/model.pkl b/models/wisp_evolution/iuwds_wrist_accel_v1/fold2/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..2e195041999750978802d30a1b3ab27796cee17a --- /dev/null +++ b/models/wisp_evolution/iuwds_wrist_accel_v1/fold2/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b9344e70583d77530fe8a694440936b094483f06e6e582834b1a3e2e09d9230 +size 266734 diff --git a/models/wisp_evolution/iuwds_wrist_accel_v1/fold3/seed42/model.pkl b/models/wisp_evolution/iuwds_wrist_accel_v1/fold3/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..248705e08609fa712740d8cfcbd9f073ed11a8f9 --- /dev/null +++ b/models/wisp_evolution/iuwds_wrist_accel_v1/fold3/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a22c61813ec149f540c737bd34e3e7488eb05fbfefe348c9d6f5a4f626bc0be +size 288208 diff --git a/models/wisp_evolution/iuwds_wrist_accel_v1/fold3/seed43/model.pkl b/models/wisp_evolution/iuwds_wrist_accel_v1/fold3/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..f02f41d7aebf0f080f99620e42bba67d01c642fb --- /dev/null +++ b/models/wisp_evolution/iuwds_wrist_accel_v1/fold3/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc486db4a47978da0ec68a942e819276c79206dd4a18237dde884231bcd3ac9e +size 338086 diff --git a/models/wisp_evolution/iuwds_wrist_accel_v1/fold3/seed44/model.pkl b/models/wisp_evolution/iuwds_wrist_accel_v1/fold3/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..7c2f55601322c5739905386495feae8c960fda64 --- /dev/null +++ b/models/wisp_evolution/iuwds_wrist_accel_v1/fold3/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:378d36025950f1bb47310bcca00bd87e5482be55e84ac0630cffb98b8b060883 +size 339803 diff --git a/models/wisp_evolution/iuwds_wrist_accel_v1/fold4/seed42/model.pkl b/models/wisp_evolution/iuwds_wrist_accel_v1/fold4/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..00165774dc545ca1dce34ce4a690921b0271e21d --- /dev/null +++ b/models/wisp_evolution/iuwds_wrist_accel_v1/fold4/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d02a047a1b63170714775755c37eb944a608a7ee30bdd074c911ff15f0efc95 +size 358831 diff --git a/models/wisp_evolution/iuwds_wrist_accel_v1/fold4/seed43/model.pkl b/models/wisp_evolution/iuwds_wrist_accel_v1/fold4/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..289625e046feb6fe20aa6b5d1a9b84e3db6eb288 --- /dev/null +++ b/models/wisp_evolution/iuwds_wrist_accel_v1/fold4/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d649153cc7bd5c8480e6281471419759e3781edb27a967ed22233fc16775f34 +size 342490 diff --git a/models/wisp_evolution/iuwds_wrist_accel_v1/fold4/seed44/model.pkl b/models/wisp_evolution/iuwds_wrist_accel_v1/fold4/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..eaa837e9ebbe9b5cbd29407d629db0ff0720b80a --- /dev/null +++ b/models/wisp_evolution/iuwds_wrist_accel_v1/fold4/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d385cbf979f12f2e1fa3a129f70e1a4d7f3f117a83b9efd811e9ea8a0fe59b7c +size 337538 diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed42/checkpoint.json b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed42/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..960e4db34d51dbf11f7c2d406dfcb72175c308e5 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed42/checkpoint.json @@ -0,0 +1,145 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "mhealth_right_lower_arm_v1", + "fold": 0, + "seed": 42, + "split_seed": 1000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 9 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z", + "gyro_x", + "gyro_y", + "gyro_z", + "mag_x", + "mag_y", + "mag_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "arm_elevation", + "climbing_stairs", + "cycling", + "jogging", + "jump_front_back", + "knees_bending", + "lying", + "running", + "sitting", + "standing", + "waist_bends", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 512, + "classifier": "ridge", + "use_hmm": false, + "seed": 43789, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "argmax", + "ridge" + ], + "route": "cpu", + "parent_id": "g011c0170_94eb8f3e49c6", + "mutation": "change_classifier" + }, + "selected_candidate_id": "g015c0241_b299bc7503bf", + "paper_metrics": { + "macro_f1": 0.7354886950705765, + "accuracy": 0.7267326732673267, + "balanced_accuracy": 0.7416392821031345, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "mhealth", + "source_name": "MHEALTH", + "official_url": "https://archive.ics.uci.edu/dataset/319/mhealth+dataset", + "upstream_version": "UCI release last updated 2024-03-16", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.7354886950705765, + "accuracy": 0.7267326732673267, + "balanced_accuracy": 0.7416392821031345, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "642323bd092f7af4bff81261d49a95f8d6bdd9c03bb991382807f96cd65a1b68", + "source_sha256": "642323bd092f7af4bff81261d49a95f8d6bdd9c03bb991382807f96cd65a1b68", + "bytes": 385670, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": false, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed42/model.pkl b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..54f7323f9e0673efe769c4f81fea828af198df62 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:642323bd092f7af4bff81261d49a95f8d6bdd9c03bb991382807f96cd65a1b68 +size 385670 diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed43/checkpoint.json b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed43/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..f4e3c05cc9d07d2f55cddb4765160e4c34627c63 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed43/checkpoint.json @@ -0,0 +1,145 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "mhealth_right_lower_arm_v1", + "fold": 0, + "seed": 43, + "split_seed": 1000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 9 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z", + "gyro_x", + "gyro_y", + "gyro_z", + "mag_x", + "mag_y", + "mag_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "arm_elevation", + "climbing_stairs", + "cycling", + "jogging", + "jump_front_back", + "knees_bending", + "lying", + "running", + "sitting", + "standing", + "waist_bends", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 512, + "classifier": "ridge", + "use_hmm": true, + "seed": 72798, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "hmm", + "ridge" + ], + "route": "cpu", + "parent_id": "g006c0101_cc56384380af", + "mutation": "change_classifier" + }, + "selected_candidate_id": "g018c0296_7fe8c189a437", + "paper_metrics": { + "macro_f1": 0.8188387012671772, + "accuracy": 0.8198019801980198, + "balanced_accuracy": 0.8294384057971014, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "mhealth", + "source_name": "MHEALTH", + "official_url": "https://archive.ics.uci.edu/dataset/319/mhealth+dataset", + "upstream_version": "UCI release last updated 2024-03-16", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.8188387012671772, + "accuracy": 0.8198019801980198, + "balanced_accuracy": 0.8294384057971014, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "c98af6a1ad5fa4a5acf72dbb151c2c39e8bbcff3547fb378b2655c3128fbcc6d", + "source_sha256": "c98af6a1ad5fa4a5acf72dbb151c2c39e8bbcff3547fb378b2655c3128fbcc6d", + "bytes": 389579, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed43/model.pkl b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..1479b58dcc8d0f896a402bd2f23da49c5005e690 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c98af6a1ad5fa4a5acf72dbb151c2c39e8bbcff3547fb378b2655c3128fbcc6d +size 389579 diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed44/checkpoint.json b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed44/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..f4b88429d2b009c5d6291e10cc344147a3c13129 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed44/checkpoint.json @@ -0,0 +1,145 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "mhealth_right_lower_arm_v1", + "fold": 0, + "seed": 44, + "split_seed": 1000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 9 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z", + "gyro_x", + "gyro_y", + "gyro_z", + "mag_x", + "mag_y", + "mag_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "arm_elevation", + "climbing_stairs", + "cycling", + "jogging", + "jump_front_back", + "knees_bending", + "lying", + "running", + "sitting", + "standing", + "waist_bends", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 512, + "classifier": "logreg", + "use_hmm": false, + "seed": 63661, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "logreg", + "argmax" + ], + "route": "cpu", + "parent_id": "g000c0004_bace659e0c1c", + "mutation": "change_symbolic_bins" + }, + "selected_candidate_id": "g002c0030_762d613fedcd", + "paper_metrics": { + "macro_f1": 0.7493625750406817, + "accuracy": 0.7485148514851485, + "balanced_accuracy": 0.761945989214695, + "worst_class_f1": 0.0 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "mhealth", + "source_name": "MHEALTH", + "official_url": "https://archive.ics.uci.edu/dataset/319/mhealth+dataset", + "upstream_version": "UCI release last updated 2024-03-16", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.7493625750406817, + "accuracy": 0.7485148514851485, + "balanced_accuracy": 0.761945989214695, + "worst_class_f1": 0.0 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "1a1e5ee70767382efbcf8077bd8f6b6a408593fe493ffa43a86c593202d523a5", + "source_sha256": "1a1e5ee70767382efbcf8077bd8f6b6a408593fe493ffa43a86c593202d523a5", + "bytes": 388588, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": false, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed44/model.pkl b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..89081b80865ffaa17876ebd3a03f676b15e0fbda --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold0/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a1e5ee70767382efbcf8077bd8f6b6a408593fe493ffa43a86c593202d523a5 +size 388588 diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed42/checkpoint.json b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed42/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..9acc73b95987bdaeee896db530f60aca81ded3ed --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed42/checkpoint.json @@ -0,0 +1,145 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "mhealth_right_lower_arm_v1", + "fold": 1, + "seed": 42, + "split_seed": 2000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 9 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z", + "gyro_x", + "gyro_y", + "gyro_z", + "mag_x", + "mag_y", + "mag_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "arm_elevation", + "climbing_stairs", + "cycling", + "jogging", + "jump_front_back", + "knees_bending", + "lying", + "running", + "sitting", + "standing", + "waist_bends", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 512, + "classifier": "logreg", + "use_hmm": true, + "seed": 178056, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "logreg", + "hmm" + ], + "route": "cpu", + "parent_id": "g013c0206_fd3b3da2c4d2", + "mutation": "change_symbolic_bins" + }, + "selected_candidate_id": "g015c0239_42aeb43353e2", + "paper_metrics": { + "macro_f1": 0.8135257169451995, + "accuracy": 0.8317214700193424, + "balanced_accuracy": 0.8389626741846908, + "worst_class_f1": 0.5352112676056338 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "mhealth", + "source_name": "MHEALTH", + "official_url": "https://archive.ics.uci.edu/dataset/319/mhealth+dataset", + "upstream_version": "UCI release last updated 2024-03-16", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.8135257169451995, + "accuracy": 0.8317214700193424, + "balanced_accuracy": 0.8389626741846908, + "worst_class_f1": 0.5352112676056338 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "b6b4cad4225d36f51a87164af7f5ae2cb9686f93958bb781e20b0cd92fe2b143", + "source_sha256": "b6b4cad4225d36f51a87164af7f5ae2cb9686f93958bb781e20b0cd92fe2b143", + "bytes": 388809, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed42/model.pkl b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..94a38123c8aae72704c519285fedeaf20d3b19fb --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6b4cad4225d36f51a87164af7f5ae2cb9686f93958bb781e20b0cd92fe2b143 +size 388809 diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed43/checkpoint.json b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed43/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..963c65ef6264c4b4343c7c77ea8f12f619528424 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed43/checkpoint.json @@ -0,0 +1,145 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "mhealth_right_lower_arm_v1", + "fold": 1, + "seed": 43, + "split_seed": 2000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 9 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z", + "gyro_x", + "gyro_y", + "gyro_z", + "mag_x", + "mag_y", + "mag_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "arm_elevation", + "climbing_stairs", + "cycling", + "jogging", + "jump_front_back", + "knees_bending", + "lying", + "running", + "sitting", + "standing", + "waist_bends", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 512, + "classifier": "logreg", + "use_hmm": true, + "seed": 115075, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "logreg", + "hmm" + ], + "route": "cpu", + "parent_id": "g002c0040_9b4adb339679", + "mutation": "change_symbolic_bins" + }, + "selected_candidate_id": "g012c0186_0b6150f5765b", + "paper_metrics": { + "macro_f1": 0.8224755450020339, + "accuracy": 0.8355899419729207, + "balanced_accuracy": 0.8430465618254703, + "worst_class_f1": 0.5526315789473685 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "mhealth", + "source_name": "MHEALTH", + "official_url": "https://archive.ics.uci.edu/dataset/319/mhealth+dataset", + "upstream_version": "UCI release last updated 2024-03-16", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.8224755450020339, + "accuracy": 0.8355899419729207, + "balanced_accuracy": 0.8430465618254703, + "worst_class_f1": 0.5526315789473685 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "ea44f640f353240f0fe43c2f07b0671b8ef4d9b14da5b93e0c141cf6f051a4df", + "source_sha256": "ea44f640f353240f0fe43c2f07b0671b8ef4d9b14da5b93e0c141cf6f051a4df", + "bytes": 389448, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed43/model.pkl b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..1ebce862f449d7c43b00d83b4de8884cfc15fa84 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea44f640f353240f0fe43c2f07b0671b8ef4d9b14da5b93e0c141cf6f051a4df +size 389448 diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed44/checkpoint.json b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed44/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..c580f7d891d78a5159b0bff5622c96ba1c6292c9 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed44/checkpoint.json @@ -0,0 +1,145 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "mhealth_right_lower_arm_v1", + "fold": 1, + "seed": 44, + "split_seed": 2000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 9 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z", + "gyro_x", + "gyro_y", + "gyro_z", + "mag_x", + "mag_y", + "mag_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "arm_elevation", + "climbing_stairs", + "cycling", + "jogging", + "jump_front_back", + "knees_bending", + "lying", + "running", + "sitting", + "standing", + "waist_bends", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 128, + "classifier": "logreg", + "use_hmm": true, + "seed": 73400, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "logreg", + "hmm" + ], + "route": "cpu", + "parent_id": "g003c0054_27c2c068a930", + "mutation": "change_rocket_kernels" + }, + "selected_candidate_id": "g014c0220_e26a8f6549cc", + "paper_metrics": { + "macro_f1": 0.7123372087360301, + "accuracy": 0.7330754352030948, + "balanced_accuracy": 0.74444591280854, + "worst_class_f1": 0.1142857142857142 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 8.326672684688674e-17 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "mhealth", + "source_name": "MHEALTH", + "official_url": "https://archive.ics.uci.edu/dataset/319/mhealth+dataset", + "upstream_version": "UCI release last updated 2024-03-16", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 8.326672684688674e-17 + }, + "metrics": { + "macro_f1": 0.7123372087360301, + "accuracy": 0.7330754352030948, + "balanced_accuracy": 0.74444591280854, + "worst_class_f1": 0.11428571428571428 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "e4fa923163e155f243de5e81ab01b0dfd68897c2d30b760261d78939901d607b", + "source_sha256": "e4fa923163e155f243de5e81ab01b0dfd68897c2d30b760261d78939901d607b", + "bytes": 99292, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed44/model.pkl b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..904d4f1036f408ea62e416ecc3aab05c21fa5774 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold1/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4fa923163e155f243de5e81ab01b0dfd68897c2d30b760261d78939901d607b +size 99292 diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed42/checkpoint.json b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed42/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..7eb141142405365fe3c496151a22685a2d195aa4 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed42/checkpoint.json @@ -0,0 +1,154 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "mhealth_right_lower_arm_v1", + "fold": 2, + "seed": 42, + "split_seed": 3000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 9 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z", + "gyro_x", + "gyro_y", + "gyro_z", + "mag_x", + "mag_y", + "mag_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "arm_elevation", + "climbing_stairs", + "cycling", + "jogging", + "jump_front_back", + "knees_bending", + "lying", + "running", + "sitting", + "standing", + "waist_bends", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "har_sculpt_forest_hmm", + "params": { + "classifier": "rf", + "use_hmm": true, + "segment_sizes": [ + 4, + 8, + 16 + ], + "symbolic_bins": 5, + "seed": 78666, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "magnitude", + "jerk", + "multiscale_stats", + "fft_bands", + "autocorr", + "symbolic_transition", + "hmm", + "rf" + ], + "route": "cpu", + "parent_id": "g002c0040_2de387f7eedd", + "mutation": "change_classifier" + }, + "selected_candidate_id": "g003c0055_05eb74433f70", + "paper_metrics": { + "macro_f1": 0.8878789083727651, + "accuracy": 0.884393063583815, + "balanced_accuracy": 0.8913043478260869, + "worst_class_f1": 0.5542168674698795 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "mhealth", + "source_name": "MHEALTH", + "official_url": "https://archive.ics.uci.edu/dataset/319/mhealth+dataset", + "upstream_version": "UCI release last updated 2024-03-16", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.8878789083727651, + "accuracy": 0.884393063583815, + "balanced_accuracy": 0.8913043478260869, + "worst_class_f1": 0.5542168674698795 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "ce8c0b79823ca0e9198b9705a7708e6417d0465501e611c72e131206ae690b15", + "source_sha256": "ce8c0b79823ca0e9198b9705a7708e6417d0465501e611c72e131206ae690b15", + "bytes": 6680248, + "copy_action": "copied", + "loaded_model_class": "HarSculptForestHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed42/model.pkl b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..bb31e723e5640917f26ba613eec7a28f84711534 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce8c0b79823ca0e9198b9705a7708e6417d0465501e611c72e131206ae690b15 +size 6680248 diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed43/checkpoint.json b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed43/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..fbb9c70261fcd715b285c9b19eab0b29b09bbffd --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed43/checkpoint.json @@ -0,0 +1,152 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "mhealth_right_lower_arm_v1", + "fold": 2, + "seed": 43, + "split_seed": 3000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 9 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z", + "gyro_x", + "gyro_y", + "gyro_z", + "mag_x", + "mag_y", + "mag_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "arm_elevation", + "climbing_stairs", + "cycling", + "jogging", + "jump_front_back", + "knees_bending", + "lying", + "running", + "sitting", + "standing", + "waist_bends", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "har_sculpt_forest_hmm", + "params": { + "classifier": "extratrees", + "use_hmm": true, + "segment_sizes": [ + 3, + 4, + 16 + ], + "symbolic_bins": 8, + "seed": 141434, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "magnitude", + "multiscale_stats", + "autocorr", + "symbolic_transition", + "hmm", + "extratrees" + ], + "route": "cpu", + "parent_id": "g014c0217_124d431e405c", + "mutation": "change_rocket_kernels" + }, + "selected_candidate_id": "g015c0239_124fe7997106", + "paper_metrics": { + "macro_f1": 0.9111111111111112, + "accuracy": 0.9113680154142582, + "balanced_accuracy": 0.9166666666666666, + "worst_class_f1": 0.6666666666666666 + }, + "raw_historical_metric_deltas": { + "macro_f1": -1.1102230246251565e-16, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "mhealth", + "source_name": "MHEALTH", + "official_url": "https://archive.ics.uci.edu/dataset/319/mhealth+dataset", + "upstream_version": "UCI release last updated 2024-03-16", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": -1.1102230246251565e-16, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.9111111111111111, + "accuracy": 0.9113680154142582, + "balanced_accuracy": 0.9166666666666666, + "worst_class_f1": 0.6666666666666666 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "b03a1eba1b9ba1d5f14bf9454de555f8b0214b3e6020f363d0e32d2f7ca345b3", + "source_sha256": "b03a1eba1b9ba1d5f14bf9454de555f8b0214b3e6020f363d0e32d2f7ca345b3", + "bytes": 16192319, + "copy_action": "copied", + "loaded_model_class": "HarSculptForestHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed43/model.pkl b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..d0eee453da582f2332e8a42cbd987ef04961043c --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b03a1eba1b9ba1d5f14bf9454de555f8b0214b3e6020f363d0e32d2f7ca345b3 +size 16192319 diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed44/checkpoint.json b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed44/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..cbfa944d115054e740d45d7b253cc19bf827052e --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed44/checkpoint.json @@ -0,0 +1,154 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "mhealth_right_lower_arm_v1", + "fold": 2, + "seed": 44, + "split_seed": 3000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 9 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z", + "gyro_x", + "gyro_y", + "gyro_z", + "mag_x", + "mag_y", + "mag_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "arm_elevation", + "climbing_stairs", + "cycling", + "jogging", + "jump_front_back", + "knees_bending", + "lying", + "running", + "sitting", + "standing", + "waist_bends", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "har_sculpt_forest_hmm", + "params": { + "classifier": "extratrees", + "use_hmm": true, + "segment_sizes": [ + 4, + 10, + 25 + ], + "symbolic_bins": 6, + "seed": 193221, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "magnitude", + "jerk", + "multiscale_stats", + "fft_bands", + "autocorr", + "symbolic_transition", + "extratrees", + "hmm" + ], + "route": "cpu", + "parent_id": "g005c0079_c4a9eea0475d", + "mutation": "change_rocket_kernels" + }, + "selected_candidate_id": "g007c0112_54c928fac6af", + "paper_metrics": { + "macro_f1": 0.877856486947396, + "accuracy": 0.8959537572254336, + "balanced_accuracy": 0.8731884057971014, + "worst_class_f1": 0.6571428571428571 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "mhealth", + "source_name": "MHEALTH", + "official_url": "https://archive.ics.uci.edu/dataset/319/mhealth+dataset", + "upstream_version": "UCI release last updated 2024-03-16", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.877856486947396, + "accuracy": 0.8959537572254336, + "balanced_accuracy": 0.8731884057971014, + "worst_class_f1": 0.6571428571428571 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "619961db831ef97b705ff4251ab9de1c1e5f62c9d9a174974ca4372ce9b765d3", + "source_sha256": "619961db831ef97b705ff4251ab9de1c1e5f62c9d9a174974ca4372ce9b765d3", + "bytes": 16911563, + "copy_action": "copied", + "loaded_model_class": "HarSculptForestHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed44/model.pkl b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..eed7c5ba7b587fc2845c174a7c23ba44a6548129 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold2/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:619961db831ef97b705ff4251ab9de1c1e5f62c9d9a174974ca4372ce9b765d3 +size 16911563 diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed42/checkpoint.json b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed42/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..84819f9210f1d73d94cdd974b455ffde2e2687c4 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed42/checkpoint.json @@ -0,0 +1,145 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "mhealth_right_lower_arm_v1", + "fold": 3, + "seed": 42, + "split_seed": 4000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 9 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z", + "gyro_x", + "gyro_y", + "gyro_z", + "mag_x", + "mag_y", + "mag_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "arm_elevation", + "climbing_stairs", + "cycling", + "jogging", + "jump_front_back", + "knees_bending", + "lying", + "running", + "sitting", + "standing", + "waist_bends", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 512, + "classifier": "logreg", + "use_hmm": true, + "seed": 81896, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "hmm", + "logreg" + ], + "route": "cpu", + "parent_id": "g004c0069_24c76e88dd90", + "mutation": "change_classifier" + }, + "selected_candidate_id": "g011c0174_a2bd54ae7957", + "paper_metrics": { + "macro_f1": 0.9296020533702118, + "accuracy": 0.929549902152642, + "balanced_accuracy": 0.9320460673468762, + "worst_class_f1": 0.676923076923077 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": -1.1102230246251565e-16, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "mhealth", + "source_name": "MHEALTH", + "official_url": "https://archive.ics.uci.edu/dataset/319/mhealth+dataset", + "upstream_version": "UCI release last updated 2024-03-16", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": -1.1102230246251565e-16, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.9296020533702118, + "accuracy": 0.9295499021526419, + "balanced_accuracy": 0.9320460673468762, + "worst_class_f1": 0.676923076923077 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "c12d0ad33340bdfaa17619d0480c221971f88ad98b2f9782328b8ec64c775bd9", + "source_sha256": "c12d0ad33340bdfaa17619d0480c221971f88ad98b2f9782328b8ec64c775bd9", + "bytes": 387408, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed42/model.pkl b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..fd4baa808e2b1768101e40eb6407f66843a35221 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c12d0ad33340bdfaa17619d0480c221971f88ad98b2f9782328b8ec64c775bd9 +size 387408 diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed43/checkpoint.json b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed43/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..7fc33a24b1fd4e4a2d979ab90626653f7e10c76d --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed43/checkpoint.json @@ -0,0 +1,145 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "mhealth_right_lower_arm_v1", + "fold": 3, + "seed": 43, + "split_seed": 4000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 9 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z", + "gyro_x", + "gyro_y", + "gyro_z", + "mag_x", + "mag_y", + "mag_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "arm_elevation", + "climbing_stairs", + "cycling", + "jogging", + "jump_front_back", + "knees_bending", + "lying", + "running", + "sitting", + "standing", + "waist_bends", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 128, + "classifier": "logreg", + "use_hmm": true, + "seed": 114189, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "logreg", + "hmm" + ], + "route": "cpu", + "parent_id": "g006c0103_edb4038f0a9a", + "mutation": "change_rocket_kernels" + }, + "selected_candidate_id": "g012c0190_aafb5b65cc45", + "paper_metrics": { + "macro_f1": 0.888480483344134, + "accuracy": 0.8904109589041096, + "balanced_accuracy": 0.8949656539393648, + "worst_class_f1": 0.5423728813559322 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "mhealth", + "source_name": "MHEALTH", + "official_url": "https://archive.ics.uci.edu/dataset/319/mhealth+dataset", + "upstream_version": "UCI release last updated 2024-03-16", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.888480483344134, + "accuracy": 0.8904109589041096, + "balanced_accuracy": 0.8949656539393648, + "worst_class_f1": 0.5423728813559322 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "cd5e821662f61f83e72b853c5ec5c1bc544b8d90ff9eb27351f715dfc7ef1654", + "source_sha256": "cd5e821662f61f83e72b853c5ec5c1bc544b8d90ff9eb27351f715dfc7ef1654", + "bytes": 100328, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed43/model.pkl b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..1a191d1eba3588e15039f3822a8aa70ed9184d18 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd5e821662f61f83e72b853c5ec5c1bc544b8d90ff9eb27351f715dfc7ef1654 +size 100328 diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed44/checkpoint.json b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed44/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..e7895d980cbe6dfc8af42293e2b6c025d41dd39e --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed44/checkpoint.json @@ -0,0 +1,145 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "mhealth_right_lower_arm_v1", + "fold": 3, + "seed": 44, + "split_seed": 4000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 9 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z", + "gyro_x", + "gyro_y", + "gyro_z", + "mag_x", + "mag_y", + "mag_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "arm_elevation", + "climbing_stairs", + "cycling", + "jogging", + "jump_front_back", + "knees_bending", + "lying", + "running", + "sitting", + "standing", + "waist_bends", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "rocket_sketch_ridge_hmm", + "params": { + "n_kernels": 384, + "classifier": "logreg", + "use_hmm": false, + "seed": 68918, + "n_jobs": 1 + }, + "operators": [ + "zscore", + "random_conv", + "ppv_max_mean_std", + "argmax", + "logreg" + ], + "route": "cpu", + "parent_id": "g004c0064_2ed3640feb93", + "mutation": "change_rocket_kernels" + }, + "selected_candidate_id": "g020c0316_94c902b027cf", + "paper_metrics": { + "macro_f1": 0.8694335167724162, + "accuracy": 0.8688845401174168, + "balanced_accuracy": 0.8672814378072213, + "worst_class_f1": 0.64 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "mhealth", + "source_name": "MHEALTH", + "official_url": "https://archive.ics.uci.edu/dataset/319/mhealth+dataset", + "upstream_version": "UCI release last updated 2024-03-16", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.8694335167724162, + "accuracy": 0.8688845401174168, + "balanced_accuracy": 0.8672814378072213, + "worst_class_f1": 0.64 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "a7d10e300109478314430a4eb69c1a26724258d09f1f95448fc6061bfa54862a", + "source_sha256": "a7d10e300109478314430a4eb69c1a26724258d09f1f95448fc6061bfa54862a", + "bytes": 291189, + "copy_action": "copied", + "loaded_model_class": "RocketSketchRidgeHMM", + "uses_sequence_decoder": false, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed44/model.pkl b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..5e6902774fbfdacdc50c2cfcb975e7eeb67aff08 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold3/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7d10e300109478314430a4eb69c1a26724258d09f1f95448fc6061bfa54862a +size 291189 diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed42/checkpoint.json b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed42/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..06e31b3b8c92cceeaabdbdd62e51d7da03dbcafd --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed42/checkpoint.json @@ -0,0 +1,144 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "mhealth_right_lower_arm_v1", + "fold": 4, + "seed": 42, + "split_seed": 5000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 9 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z", + "gyro_x", + "gyro_y", + "gyro_z", + "mag_x", + "mag_y", + "mag_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "arm_elevation", + "climbing_stairs", + "cycling", + "jogging", + "jump_front_back", + "knees_bending", + "lying", + "running", + "sitting", + "standing", + "waist_bends", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "symbolic_interval_forest", + "params": { + "use_hmm": true, + "seed": 46, + "n_jobs": 1 + }, + "operators": [ + "segment", + "aggregate_stats", + "quantize", + "transition_histogram", + "extratrees", + "hmm" + ], + "route": "cpu", + "parent_id": null, + "mutation": null + }, + "selected_candidate_id": "g000c0005_a576e189e5c4", + "paper_metrics": { + "macro_f1": 0.8318056467541005, + "accuracy": 0.8230616302186878, + "balanced_accuracy": 0.8346920289855072, + "worst_class_f1": 0.5 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "mhealth", + "source_name": "MHEALTH", + "official_url": "https://archive.ics.uci.edu/dataset/319/mhealth+dataset", + "upstream_version": "UCI release last updated 2024-03-16", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 0.0 + }, + "metrics": { + "macro_f1": 0.8318056467541005, + "accuracy": 0.8230616302186878, + "balanced_accuracy": 0.8346920289855072, + "worst_class_f1": 0.5 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "c3c4a01d438ce5ecd6b04091d0a8514f61ef8601fa4ed5227c473308b0af42d9", + "source_sha256": "c3c4a01d438ce5ecd6b04091d0a8514f61ef8601fa4ed5227c473308b0af42d9", + "bytes": 30961327, + "copy_action": "copied", + "loaded_model_class": "SymbolicIntervalForest", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed42/model.pkl b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed42/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..a113616e2633da816c05e7d2eade64f664fa7f68 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed42/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3c4a01d438ce5ecd6b04091d0a8514f61ef8601fa4ed5227c473308b0af42d9 +size 30961327 diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed43/checkpoint.json b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed43/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..a2c8d5df00e82a709268bd8068bf422f2ebb7158 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed43/checkpoint.json @@ -0,0 +1,144 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "mhealth_right_lower_arm_v1", + "fold": 4, + "seed": 43, + "split_seed": 5000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 9 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z", + "gyro_x", + "gyro_y", + "gyro_z", + "mag_x", + "mag_y", + "mag_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "arm_elevation", + "climbing_stairs", + "cycling", + "jogging", + "jump_front_back", + "knees_bending", + "lying", + "running", + "sitting", + "standing", + "waist_bends", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "symbolic_interval_forest", + "params": { + "use_hmm": true, + "seed": 47, + "n_jobs": 1 + }, + "operators": [ + "segment", + "aggregate_stats", + "quantize", + "transition_histogram", + "extratrees", + "hmm" + ], + "route": "cpu", + "parent_id": null, + "mutation": null + }, + "selected_candidate_id": "g000c0005_26a8d253bba9", + "paper_metrics": { + "macro_f1": 0.8414983164983165, + "accuracy": 0.8489065606361829, + "balanced_accuracy": 0.8333333333333334, + "worst_class_f1": 0.4646464646464646 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 5.551115123125783e-17 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "mhealth", + "source_name": "MHEALTH", + "official_url": "https://archive.ics.uci.edu/dataset/319/mhealth+dataset", + "upstream_version": "UCI release last updated 2024-03-16", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 5.551115123125783e-17 + }, + "metrics": { + "macro_f1": 0.8414983164983165, + "accuracy": 0.8489065606361829, + "balanced_accuracy": 0.8333333333333334, + "worst_class_f1": 0.46464646464646464 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "cb2eb0d0b2dfc1e6692fdeb57a8fbcae3132439f68cd7192c107bbc48a118b89", + "source_sha256": "cb2eb0d0b2dfc1e6692fdeb57a8fbcae3132439f68cd7192c107bbc48a118b89", + "bytes": 30830438, + "copy_action": "copied", + "loaded_model_class": "SymbolicIntervalForest", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed43/model.pkl b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed43/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..fa6e640cc1366c1f9a8b9a3beecd31f44ce335d5 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed43/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb2eb0d0b2dfc1e6692fdeb57a8fbcae3132439f68cd7192c107bbc48a118b89 +size 30830438 diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed44/checkpoint.json b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed44/checkpoint.json new file mode 100644 index 0000000000000000000000000000000000000000..ed9f9462198d7c80da684e177b143d17d75b4ac3 --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed44/checkpoint.json @@ -0,0 +1,144 @@ +{ + "schema_version": 1, + "method": "wisp_evolution", + "method_name": "WISP-Evolution", + "dataset": "mhealth_right_lower_arm_v1", + "fold": 4, + "seed": 44, + "split_seed": 5000, + "fit_scope": "train+validation", + "input_shape": [ + 250, + 9 + ], + "channels": [ + "acc_x", + "acc_y", + "acc_z", + "gyro_x", + "gyro_y", + "gyro_z", + "mag_x", + "mag_y", + "mag_z" + ], + "sampling_rate_hz": 50.0, + "label_names": [ + "arm_elevation", + "climbing_stairs", + "cycling", + "jogging", + "jump_front_back", + "knees_bending", + "lying", + "running", + "sitting", + "standing", + "waist_bends", + "walking" + ], + "global_class_ids": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11 + ], + "data_repository": "Zipeng365/WristHARBench", + "data_revision": "5e6af3c5c6dca050e73c06f49272f9656c0f259f", + "data_scope": "paper_snapshot_20260828", + "selected_recipe": { + "name": "symbolic_interval_forest", + "params": { + "use_hmm": true, + "seed": 48, + "n_jobs": 1 + }, + "operators": [ + "segment", + "aggregate_stats", + "quantize", + "transition_histogram", + "extratrees", + "hmm" + ], + "route": "cpu", + "parent_id": null, + "mutation": null + }, + "selected_candidate_id": "g000c0005_869d9156c7cc", + "paper_metrics": { + "macro_f1": 0.8392896169265338, + "accuracy": 0.8469184890656064, + "balanced_accuracy": 0.8315217391304349, + "worst_class_f1": 0.4646464646464646 + }, + "raw_historical_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 5.551115123125783e-17 + }, + "raw_historical_metrics_match_paper": true, + "historical_metric_note": "Paper scores use the frozen full-vocabulary worst-class F1 definition; historical sibling JSON can use a different class scope. No checkpoint or paper values are rewritten.", + "training_data_source": { + "source_id": "mhealth", + "source_name": "MHEALTH", + "official_url": "https://archive.ics.uci.edu/dataset/319/mhealth+dataset", + "upstream_version": "UCI release last updated 2024-03-16", + "license": "cc-by-4.0", + "license_url": "https://creativecommons.org/licenses/by/4.0/" + }, + "checkpoint_license_note": "Code license does not automatically license these checkpoints. Observe the identified source-data terms; shapelet models can retain training-derived prototypes.", + "pickle_security": "Loading this file executes Python code. Explicit trust is required; SHA256 checks integrity, not publisher identity.", + "source_checkpoint_bytes_unchanged": true, + "validation": { + "load": "passed", + "synthetic_prediction": "passed", + "saved_prediction_metrics": { + "status": "passed", + "paper_metric_deltas": { + "macro_f1": 0.0, + "accuracy": 0.0, + "balanced_accuracy": 0.0, + "worst_class_f1": 5.551115123125783e-17 + }, + "metrics": { + "macro_f1": 0.8392896169265338, + "accuracy": 0.8469184890656064, + "balanced_accuracy": 0.8315217391304349, + "worst_class_f1": 0.46464646464646464 + }, + "claim_boundary": "Rescoring immutable saved predictions is not rerunning checkpoint inference on every frozen test split." + }, + "frozen_prediction": { + "status": "not_run" + } + }, + "sha256": "e9b6153280a1a0515086dcb052677e4ef9525a52e4eaba7988f5974d590abef0", + "source_sha256": "e9b6153280a1a0515086dcb052677e4ef9525a52e4eaba7988f5974d590abef0", + "bytes": 30621176, + "copy_action": "copied", + "loaded_model_class": "SymbolicIntervalForest", + "uses_sequence_decoder": true, + "validated_environment": { + "wisp-har": "0.1.0", + "numpy": "2.3.5", + "scipy": "1.17.1", + "scikit-learn": "1.7.2", + "joblib": "1.5.3", + "threadpoolctl": "3.6.0", + "python": "3.12.13" + }, + "validated_code_provenance": { + "release_wheel_sha256": "89c1cccabaf095b66fe8d4b82a007b868316302ca613d6bfe1a9a8b2995876b0", + "installed_checkpoint_api_sha256": "261bf3c45c2ef7f5a21ff188533aa19a46a6774e261fb6ee1d0f25cfb794b47f" + } +} diff --git a/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed44/model.pkl b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..cadd1adba9627b629e27a94cf5c5cff00888cc8a --- /dev/null +++ b/models/wisp_evolution/mhealth_right_lower_arm_v1/fold4/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9b6153280a1a0515086dcb052677e4ef9525a52e4eaba7988f5974d590abef0 +size 30621176 diff --git a/models/wisp_evolution/wisdm_watch_accel_v1/fold2/seed44/model.pkl b/models/wisp_evolution/wisdm_watch_accel_v1/fold2/seed44/model.pkl new file mode 100644 index 0000000000000000000000000000000000000000..6f04cf8d6c8b13b65671e8a6139838c10fd5f8f8 --- /dev/null +++ b/models/wisp_evolution/wisdm_watch_accel_v1/fold2/seed44/model.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a6544700bc41317febaa9a6fccf239bea2eaa23679f880b1d874ff9c035da32 +size 1346779355 diff --git a/src/wisp/__init__.py b/src/wisp/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/src/wisp/__init__.py @@ -0,0 +1 @@ + diff --git a/src/wisp/ablations.py b/src/wisp/ablations.py new file mode 100644 index 0000000000000000000000000000000000000000..e5f0f0482d6f99260ed8cd3e2a25e83167ec1ebd --- /dev/null +++ b/src/wisp/ablations.py @@ -0,0 +1,54 @@ +# Paper-scoped implementation; see SOURCE_PROVENANCE.json. +from __future__ import annotations +from dataclasses import asdict, dataclass +from typing import Any +from wisp.cis_algorithms import build_cpu_estimator +from wisp.search.grammar import CandidateSpec + +@dataclass(frozen=True) +class RecipeSpec: + recipe_id: str + component_tag: str + label: str + use_rocket: bool + use_intervals: bool + use_state: bool + use_hmm: bool + n_kernels: int = 384 + n_intervals: int = 24 + classifier: str = 'ridge' + use_anchor_stats: bool = False + class_balance: str = 'balanced' + + def to_candidate(self, *, seed: int, n_jobs: int) -> CandidateSpec: + operators: list[str] = ['zscore'] + if self.use_rocket: + operators.extend(['random_conv', 'ppv_pool']) + if self.use_intervals: + operators.extend(['dyadic_intervals', 'quantile_distribution']) + if self.use_state: + operators.extend(['magnitude', 'jerk', 'spectral', 'autocorr', 'symbolic_transition']) + operators.extend([self.classifier, 'hmm' if self.use_hmm else 'argmax']) + return CandidateSpec(name='state_rocket_interval_hmm', route='cpu', params={'n_kernels': int(self.n_kernels), 'n_intervals': int(self.n_intervals), 'classifier': self.classifier, 'use_hmm': bool(self.use_hmm), 'use_rocket': bool(self.use_rocket), 'use_intervals': bool(self.use_intervals), 'use_state': bool(self.use_state), 'use_anchor_stats': False, 'class_balance': self.class_balance, 'seed': int(seed), 'n_jobs': int(n_jobs)}, operators=operators) + + def to_dict(self) -> dict[str, Any]: + return asdict(self) +_COMPONENTS: tuple[tuple[str, bool, bool, bool], ...] = (('R', True, False, False), ('I', False, True, False), ('S', False, False, True), ('RI', True, True, False), ('RS', True, False, True), ('IS', False, True, True), ('RIS', True, True, True)) +CIS_ABLATIONS: tuple[RecipeSpec, ...] = tuple((RecipeSpec(recipe_id=f"cis_ablation_{tag}_{('viterbi' if use_hmm else 'direct')}", component_tag=tag, label=f"{tag}+{('H' if use_hmm else 'direct')}", use_rocket=rocket, use_intervals=intervals, use_state=state, use_hmm=use_hmm) for tag, rocket, intervals, state in _COMPONENTS for use_hmm in (False, True))) +CIS_BY_ID = {spec.recipe_id: spec for spec in CIS_ABLATIONS} +FULL_CIS_ID = 'cis_ablation_RIS_viterbi' + +def get_recipe_spec(recipe_id: str) -> RecipeSpec: + try: + return CIS_BY_ID[recipe_id] + except KeyError as exc: + raise KeyError(f'Unknown paper recipe {recipe_id!r}; expected one of {sorted(CIS_BY_ID)}') from exc + +def build_recipe(recipe_id: str, *, seed: int, n_jobs: int): + spec = get_recipe_spec(recipe_id).to_candidate(seed=seed, n_jobs=n_jobs) + return build_cpu_estimator(spec.to_dict()) + +def resolved_recipe(recipe_id: str, *, seed: int, n_jobs: int) -> dict[str, Any]: + spec = get_recipe_spec(recipe_id) + return {**spec.to_dict(), 'candidate_spec': spec.to_candidate(seed=seed, n_jobs=n_jobs).to_dict(), 'design_name': 'controlled F6 representation combinations', 'frozen_f6_equivalent': recipe_id == FULL_CIS_ID, 'claim_boundary': 'Seven non-empty R/I/S representation combinations are crossed with direct/H. The design supports predeclared representation-addition, representation-removal and decoder contrasts. Because an empty-representation cell is illegal, it is not an unrestricted complete 2^3 factorial. RIS+H exactly matches the frozen F6 code settings.'} +__all__ = ['RecipeSpec', 'CIS_ABLATIONS', 'CIS_BY_ID', 'FULL_CIS_ID', 'get_recipe_spec', 'build_recipe', 'resolved_recipe'] diff --git a/src/wisp/cis_algorithms.py b/src/wisp/cis_algorithms.py new file mode 100644 index 0000000000000000000000000000000000000000..f66ff803f957463277ea788262d8fbabe01bffe5 --- /dev/null +++ b/src/wisp/cis_algorithms.py @@ -0,0 +1,456 @@ +# Paper-scoped implementation; see SOURCE_PROVENANCE.json. +from __future__ import annotations +import pickle +import time +from contextlib import contextmanager +from dataclasses import dataclass, field +from typing import Any, Literal +import numpy as np +from numpy.typing import NDArray +from sklearn.base import BaseEstimator, ClassifierMixin +from sklearn.ensemble import ExtraTreesClassifier, RandomForestClassifier +from sklearn.linear_model import LogisticRegression, RidgeClassifierCV +from sklearn.pipeline import Pipeline +from sklearn.preprocessing import StandardScaler +from sklearn.utils.class_weight import compute_sample_weight +from wisp.cpu.features import IntervalDistributionSketch, InvariantPhysicsFeatureExtractor, RandomConvSketch, RandomShapeletSketch, WearableFeatureExtractor +from wisp.cpu.hmm import TransitionSmoother +from wisp.cpu.probability import estimator_proba, global_classes, labels_from_proba + +@contextmanager +def _ridge_svd_fallback_driver(): + from sklearn.linear_model import _ridge + original_svd = _ridge.linalg.svd + + def robust_svd(*args: Any, **kwargs: Any) -> Any: + try: + return original_svd(*args, **kwargs) + except np.linalg.LinAlgError: + if kwargs.get('lapack_driver') == 'gesvd': + raise + retry_kwargs = dict(kwargs) + retry_kwargs['lapack_driver'] = 'gesvd' + return original_svd(*args, **retry_kwargs) + _ridge.linalg.svd = robust_svd + try: + yield + finally: + _ridge.linalg.svd = original_svd + +class StableRidgeClassifierCV(RidgeClassifierCV): + svd_fallback_policy_: str + + def fit(self, X: Any, y: Any, sample_weight: Any=None, **params: Any) -> Any: + self.svd_fallback_policy_ = 'gesdd_then_gesvd_on_nonconvergence' + with _ridge_svd_fallback_driver(): + return super().fit(X, y, sample_weight=sample_weight, **params) + +def _classifier(kind: str, *, seed: int, n_jobs: int=-1, class_balance: Literal['balanced', 'none']='balanced') -> Any: + if class_balance not in {'balanced', 'none'}: + raise ValueError(f'Unknown class_balance={class_balance!r}') + balanced = class_balance == 'balanced' + if kind == 'extratrees': + return ExtraTreesClassifier(n_estimators=120, max_features='sqrt', min_samples_leaf=1, class_weight='balanced' if balanced else None, random_state=seed, n_jobs=n_jobs) + if kind == 'rf': + return RandomForestClassifier(n_estimators=120, max_features='sqrt', min_samples_leaf=1, class_weight='balanced_subsample' if balanced else None, random_state=seed, n_jobs=n_jobs) + if kind == 'logreg': + return LogisticRegression(C=2.0, max_iter=2000, class_weight='balanced' if balanced else None, solver='lbfgs', random_state=seed) + if kind == 'ridge': + return StableRidgeClassifierCV(alphas=np.logspace(-3, 3, 9)) + raise ValueError(f'Unknown classifier kind: {kind}') + +class _HMMMixin: + use_hmm: bool + smoother_: TransitionSmoother | None + classes_: NDArray[np.int64] | None + trained_classes_: NDArray[np.int64] | None + + def _set_classes(self, y: Any, n_classes: int | None) -> None: + yy = np.asarray(y, dtype=np.int64) + self.classes_ = global_classes(yy, n_classes) + self.trained_classes_ = np.unique(yy) + + def _fit_smoother(self, y: NDArray[np.int64], groups: Any | None, time_index: Any | None) -> None: + self.smoother_ = None + if self.use_hmm: + if self.classes_ is None: + raise RuntimeError('Global class axis is not initialized') + self.smoother_ = TransitionSmoother().fit(y, groups=groups, time_index=time_index, n_classes=int(self.classes_.size)) + + def _maybe_smooth(self, proba: NDArray[np.float64], groups: Any | None, time_index: Any | None) -> NDArray[np.int64]: + if self.classes_ is None: + raise RuntimeError('Global class axis is not initialized') + if getattr(self, 'smoother_', None) is not None and groups is not None: + return self.smoother_.predict_from_proba(proba, groups=groups, time_index=time_index) + return labels_from_proba(proba, self.classes_) + +@dataclass +class HarSculptForestHMM(BaseEstimator, ClassifierMixin, _HMMMixin): + classifier: Literal['extratrees', 'rf', 'logreg'] = 'extratrees' + use_hmm: bool = True + segment_sizes: tuple[int, ...] = (4, 8, 16) + symbolic_bins: int = 6 + class_balance: Literal['balanced', 'none'] = 'balanced' + seed: int = 42 + n_jobs: int = -1 + feature_extractor_: WearableFeatureExtractor | None = field(default=None, init=False) + model_: Any = field(default=None, init=False) + smoother_: TransitionSmoother | None = field(default=None, init=False) + classes_: NDArray[np.int64] | None = field(default=None, init=False) + trained_classes_: NDArray[np.int64] | None = field(default=None, init=False) + fit_seconds_: float = field(default=0.0, init=False) + + def fit(self, X: Any, y: Any, *, groups: Any | None=None, time_index: Any | None=None, n_classes: int | None=None) -> 'HarSculptForestHMM': + start = time.perf_counter() + y = np.asarray(y, dtype=np.int64) + self._set_classes(y, n_classes) + self.feature_extractor_ = WearableFeatureExtractor(segment_sizes=self.segment_sizes, symbolic_bins=self.symbolic_bins) + F = self.feature_extractor_.fit_transform(X, y) + clf = _classifier(self.classifier, seed=self.seed, n_jobs=self.n_jobs, class_balance=self.class_balance) + if self.classifier == 'logreg': + self.model_ = Pipeline([('scale', StandardScaler()), ('clf', clf)]) + else: + self.model_ = clf + self.model_.fit(F, y) + self._fit_smoother(y, groups, time_index) + self.fit_seconds_ = time.perf_counter() - start + return self + + def predict_proba(self, X: Any) -> NDArray[np.float64]: + if self.model_ is None or self.feature_extractor_ is None or self.classes_ is None: + raise RuntimeError('Model is not fitted') + F = self.feature_extractor_.transform(X) + return estimator_proba(self.model_, F, self.classes_) + + def predict(self, X: Any, *, groups: Any | None=None, time_index: Any | None=None) -> NDArray[np.int64]: + return self._maybe_smooth(self.predict_proba(X), groups, time_index) + + def design_profile(self) -> dict[str, Any]: + return {'name': 'har_sculpt_forest_hmm', 'route': 'cpu', 'operators': ['zscore', 'magnitude', 'jerk', 'multiscale_interval_stats', 'fft_bandpower', 'autocorr', 'symbolic_transition', 'extratrees', 'hmm' if self.use_hmm else 'argmax'], 'motifs': ['orientation_invariance', 'local_periodicity', 'transition_smoothing', 'tail_class_bias']} + +@dataclass +class RocketSketchRidgeHMM(BaseEstimator, ClassifierMixin, _HMMMixin): + n_kernels: int = 384 + classifier: Literal['ridge', 'logreg'] = 'ridge' + use_hmm: bool = True + class_balance: Literal['balanced', 'none'] = 'balanced' + seed: int = 42 + n_jobs: int = -1 + sketch_: RandomConvSketch | None = field(default=None, init=False) + model_: Any = field(default=None, init=False) + smoother_: TransitionSmoother | None = field(default=None, init=False) + classes_: NDArray[np.int64] | None = field(default=None, init=False) + trained_classes_: NDArray[np.int64] | None = field(default=None, init=False) + fit_seconds_: float = field(default=0.0, init=False) + + def fit(self, X: Any, y: Any, *, groups: Any | None=None, time_index: Any | None=None, n_classes: int | None=None) -> 'RocketSketchRidgeHMM': + start = time.perf_counter() + y = np.asarray(y, dtype=np.int64) + self._set_classes(y, n_classes) + self.sketch_ = RandomConvSketch(n_kernels=self.n_kernels, random_state=self.seed) + F = self.sketch_.fit_transform(X, y) + clf = _classifier(self.classifier, seed=self.seed, n_jobs=self.n_jobs, class_balance=self.class_balance) + self.model_ = Pipeline([('scale', StandardScaler()), ('clf', clf)]) + sample_weight = compute_sample_weight('balanced', y) if self.classifier == 'ridge' and self.class_balance == 'balanced' else None + if sample_weight is not None: + self.model_.fit(F, y, clf__sample_weight=sample_weight) + else: + self.model_.fit(F, y) + self._fit_smoother(y, groups, time_index) + self.fit_seconds_ = time.perf_counter() - start + return self + + def predict_proba(self, X: Any) -> NDArray[np.float64]: + if self.model_ is None or self.sketch_ is None or self.classes_ is None: + raise RuntimeError('Model is not fitted') + F = self.sketch_.transform(X) + return estimator_proba(self.model_, F, self.classes_) + + def predict(self, X: Any, *, groups: Any | None=None, time_index: Any | None=None) -> NDArray[np.int64]: + return self._maybe_smooth(self.predict_proba(X), groups, time_index) + + def design_profile(self) -> dict[str, Any]: + return {'name': 'rocket_sketch_ridge_hmm', 'route': 'cpu', 'operators': ['zscore', 'random_conv', 'ppv_pool', 'ridge', 'hmm' if self.use_hmm else 'argmax'], 'motifs': ['phase_tolerant_local_shape', 'fast_cpu', 'transition_smoothing']} + +@dataclass +class SymbolicIntervalForest(BaseEstimator, ClassifierMixin, _HMMMixin): + use_hmm: bool = True + class_balance: Literal['balanced', 'none'] = 'balanced' + seed: int = 42 + n_jobs: int = -1 + feature_extractor_: WearableFeatureExtractor | None = field(default=None, init=False) + model_: Any = field(default=None, init=False) + smoother_: TransitionSmoother | None = field(default=None, init=False) + classes_: NDArray[np.int64] | None = field(default=None, init=False) + trained_classes_: NDArray[np.int64] | None = field(default=None, init=False) + fit_seconds_: float = field(default=0.0, init=False) + + def fit(self, X: Any, y: Any, *, groups: Any | None=None, time_index: Any | None=None, n_classes: int | None=None) -> 'SymbolicIntervalForest': + start = time.perf_counter() + y = np.asarray(y, dtype=np.int64) + self._set_classes(y, n_classes) + self.feature_extractor_ = WearableFeatureExtractor(include_raw_stats=True, include_magnitude=True, include_jerk=False, include_multiscale=True, segment_sizes=(5, 10, 20), include_spectral=False, include_autocorr=False, include_cross_channel=True, include_symbolic=True, symbolic_bins=8) + F = self.feature_extractor_.fit_transform(X, y) + self.model_ = ExtraTreesClassifier(n_estimators=160, max_features='sqrt', class_weight='balanced' if self.class_balance == 'balanced' else None, random_state=self.seed, n_jobs=self.n_jobs) + self.model_.fit(F, y) + self._fit_smoother(y, groups, time_index) + self.fit_seconds_ = time.perf_counter() - start + return self + + def predict_proba(self, X: Any) -> NDArray[np.float64]: + if self.model_ is None or self.feature_extractor_ is None or self.classes_ is None: + raise RuntimeError('Model is not fitted') + F = self.feature_extractor_.transform(X) + return estimator_proba(self.model_, F, self.classes_) + + def predict(self, X: Any, *, groups: Any | None=None, time_index: Any | None=None) -> NDArray[np.int64]: + return self._maybe_smooth(self.predict_proba(X), groups, time_index) + + def design_profile(self) -> dict[str, Any]: + return {'name': 'symbolic_interval_forest', 'route': 'cpu', 'operators': ['segment', 'aggregate_stats', 'quantize', 'transition_histogram', 'forest', 'hmm' if self.use_hmm else 'argmax'], 'motifs': ['interpretable_symbols', 'micro_pattern', 'transition_smoothing']} + +@dataclass +class HybridCPUEnsemble(BaseEstimator, ClassifierMixin): + use_hmm: bool = True + seed: int = 42 + n_jobs: int = -1 + members_: list[Any] = field(default_factory=list, init=False) + classes_: NDArray[np.int64] | None = field(default=None, init=False) + trained_classes_: NDArray[np.int64] | None = field(default=None, init=False) + fit_seconds_: float = field(default=0.0, init=False) + + def fit(self, X: Any, y: Any, *, groups: Any | None=None, time_index: Any | None=None, n_classes: int | None=None) -> 'HybridCPUEnsemble': + start = time.perf_counter() + yy = np.asarray(y, dtype=np.int64) + self.classes_ = global_classes(yy, n_classes) + self.trained_classes_ = np.unique(yy) + self.members_ = [HarSculptForestHMM(classifier='extratrees', use_hmm=False, seed=self.seed, n_jobs=self.n_jobs), RocketSketchRidgeHMM(n_kernels=256, classifier='ridge', use_hmm=False, seed=self.seed + 1, n_jobs=self.n_jobs), SymbolicIntervalForest(use_hmm=False, seed=self.seed + 2, n_jobs=self.n_jobs)] + for m in self.members_: + m.fit(X, yy, groups=groups, time_index=time_index, n_classes=int(self.classes_.size)) + self.smoother_ = TransitionSmoother().fit(yy, groups=groups, time_index=time_index, n_classes=int(self.classes_.size)) if self.use_hmm else None + self.fit_seconds_ = time.perf_counter() - start + return self + + def predict_proba(self, X: Any) -> NDArray[np.float64]: + if not self.members_ or self.classes_ is None: + raise RuntimeError('Model is not fitted') + out = np.mean([m.predict_proba(X) for m in self.members_], axis=0) + return out / np.maximum(out.sum(axis=1, keepdims=True), 1e-12) + + def predict(self, X: Any, *, groups: Any | None=None, time_index: Any | None=None) -> NDArray[np.int64]: + P = self.predict_proba(X) + if getattr(self, 'smoother_', None) is not None and groups is not None: + return self.smoother_.predict_from_proba(P, groups=groups, time_index=time_index) + return labels_from_proba(P, self.classes_) + + def design_profile(self) -> dict[str, Any]: + return {'name': 'hybrid_cpu_ensemble', 'route': 'cpu', 'operators': ['feature_union', 'random_conv', 'symbolic', 'probability_average', 'hmm' if self.use_hmm else 'argmax'], 'motifs': ['multi_view_cpu', 'robustness_by_diversity', 'transition_smoothing']} + +@dataclass +class InvariantIntervalShapeForest(BaseEstimator, ClassifierMixin, _HMMMixin): + classifier: Literal['extratrees', 'rf', 'logreg'] = 'extratrees' + use_hmm: bool = True + segment_sizes: tuple[int, ...] = (4, 8, 16) + symbolic_bins: int = 6 + n_shapelets: int = 32 + class_balance: Literal['balanced', 'none'] = 'balanced' + seed: int = 42 + n_jobs: int = -1 + physics_: InvariantPhysicsFeatureExtractor | None = field(default=None, init=False) + shapelets_: RandomShapeletSketch | None = field(default=None, init=False) + model_: Any = field(default=None, init=False) + smoother_: TransitionSmoother | None = field(default=None, init=False) + classes_: NDArray[np.int64] | None = field(default=None, init=False) + trained_classes_: NDArray[np.int64] | None = field(default=None, init=False) + fit_seconds_: float = field(default=0.0, init=False) + + def fit(self, X: Any, y: Any, *, groups: Any | None=None, time_index: Any | None=None, n_classes: int | None=None) -> 'InvariantIntervalShapeForest': + start = time.perf_counter() + y = np.asarray(y, dtype=np.int64) + self._set_classes(y, n_classes) + self.physics_ = InvariantPhysicsFeatureExtractor(segment_sizes=self.segment_sizes, symbolic_bins=int(self.symbolic_bins), random_intervals=24, random_state=self.seed, include_axis_features=True).fit(X, y) + self.shapelets_ = RandomShapeletSketch(n_shapelets=int(self.n_shapelets), random_state=self.seed + 17).fit(X, y) + F = np.concatenate([self.physics_.transform(X), self.shapelets_.transform(X)], axis=1) + clf = _classifier(self.classifier, seed=self.seed, n_jobs=self.n_jobs, class_balance=self.class_balance) + self.model_ = Pipeline([('scale', StandardScaler()), ('clf', clf)]) if self.classifier == 'logreg' else clf + self.model_.fit(F, y) + self._fit_smoother(y, groups, time_index) + self.fit_seconds_ = time.perf_counter() - start + return self + + def _features(self, X: Any) -> NDArray[np.float64]: + if self.physics_ is None or self.shapelets_ is None: + raise RuntimeError('Model is not fitted') + return np.concatenate([self.physics_.transform(X), self.shapelets_.transform(X)], axis=1) + + def predict_proba(self, X: Any) -> NDArray[np.float64]: + if self.model_ is None or self.classes_ is None: + raise RuntimeError('Model is not fitted') + return estimator_proba(self.model_, self._features(X), self.classes_) + + def predict(self, X: Any, *, groups: Any | None=None, time_index: Any | None=None) -> NDArray[np.int64]: + return self._maybe_smooth(self.predict_proba(X), groups, time_index) + + def design_profile(self) -> dict[str, Any]: + return {'name': 'invariant_interval_shape_forest', 'route': 'cpu', 'operators': ['zscore', 'magnitude', 'jerk', 'gram_eig', 'dyadic_intervals', 'quantile_distribution', 'random_shapelet', 'extratrees', 'hmm' if self.use_hmm else 'argmax'], 'motifs': ['orientation_invariance', 'device_shift_robustness', 'interval_distribution', 'local_shape', 'transition_smoothing']} + +@dataclass +class StateRocketIntervalHMM(BaseEstimator, ClassifierMixin, _HMMMixin): + n_kernels: int = 384 + n_intervals: int = 24 + classifier: Literal['ridge', 'logreg'] = 'ridge' + use_hmm: bool = True + use_rocket: bool = True + use_intervals: bool = True + use_state: bool = True + use_anchor_stats: bool = False + class_balance: Literal['balanced', 'none'] = 'balanced' + seed: int = 42 + n_jobs: int = -1 + rocket_: RandomConvSketch | None = field(default=None, init=False) + interval_: IntervalDistributionSketch | None = field(default=None, init=False) + state_: WearableFeatureExtractor | None = field(default=None, init=False) + anchor_: Any = field(default=None, init=False) + model_: Any = field(default=None, init=False) + smoother_: TransitionSmoother | None = field(default=None, init=False) + classes_: NDArray[np.int64] | None = field(default=None, init=False) + trained_classes_: NDArray[np.int64] | None = field(default=None, init=False) + fit_seconds_: float = field(default=0.0, init=False) + + def fit(self, X: Any, y: Any, *, groups: Any | None=None, time_index: Any | None=None, n_classes: int | None=None) -> 'StateRocketIntervalHMM': + start = time.perf_counter() + y = np.asarray(y, dtype=np.int64) + self._set_classes(y, n_classes) + if not (self.use_anchor_stats or self.use_rocket or self.use_intervals or self.use_state): + raise ValueError('At least one CIS representation must be enabled') + self.anchor_ = None + self.rocket_ = RandomConvSketch(n_kernels=int(self.n_kernels), random_state=self.seed).fit(X, y) if self.use_rocket else None + self.interval_ = IntervalDistributionSketch(n_random_intervals=int(self.n_intervals), random_state=self.seed + 29).fit(X, y) if self.use_intervals else None + self.state_ = WearableFeatureExtractor(include_raw_stats=False, include_magnitude=True, include_jerk=True, include_multiscale=False, include_spectral=True, include_autocorr=True, include_cross_channel=True, include_symbolic=True, symbolic_bins=6).fit(X, y) if self.use_state else None + F = self._features(X) + clf = _classifier(self.classifier, seed=self.seed, n_jobs=self.n_jobs, class_balance=self.class_balance) + self.model_ = Pipeline([('scale', StandardScaler()), ('clf', clf)]) + if self.classifier == 'ridge' and self.class_balance == 'balanced': + self.model_.fit(F, y, clf__sample_weight=compute_sample_weight('balanced', y)) + else: + self.model_.fit(F, y) + self._fit_smoother(y, groups, time_index) + self.fit_seconds_ = time.perf_counter() - start + return self + + def _features(self, X: Any) -> NDArray[np.float64]: + blocks: list[NDArray[np.float64]] = [] + if self.use_anchor_stats: + raise ValueError('Anchor statistics are not part of the paper configuration') + if self.use_rocket: + if self.rocket_ is None: + raise RuntimeError('Random convolution representation is enabled but not fitted') + blocks.append(self.rocket_.transform(X)) + if self.use_intervals: + if self.interval_ is None: + raise RuntimeError('Interval representation is enabled but not fitted') + blocks.append(self.interval_.transform(X)) + if self.use_state: + if self.state_ is None: + raise RuntimeError('Spectral, temporal and cross-axis representation is enabled but not fitted') + blocks.append(self.state_.transform(X)) + if not blocks: + raise RuntimeError('No fitted representation is available') + return np.concatenate(blocks, axis=1) + + def predict_proba(self, X: Any) -> NDArray[np.float64]: + if self.model_ is None or self.classes_ is None: + raise RuntimeError('Model is not fitted') + return estimator_proba(self.model_, self._features(X), self.classes_) + + def predict(self, X: Any, *, groups: Any | None=None, time_index: Any | None=None) -> NDArray[np.int64]: + return self._maybe_smooth(self.predict_proba(X), groups, time_index) + + def design_profile(self) -> dict[str, Any]: + operators = ['zscore'] + motifs = [] + if self.use_anchor_stats: + raise ValueError('Anchor statistics are not part of the paper configuration') + if self.use_rocket: + operators.extend(['random_conv', 'ppv_pool']) + motifs.extend(['phase_tolerant_local_shape', 'fast_cpu']) + if self.use_intervals: + operators.extend(['dyadic_intervals', 'quantile_distribution']) + motifs.append('interval_distribution') + if self.use_state: + operators.extend(['magnitude', 'jerk', 'spectral', 'autocorr', 'symbolic_transition']) + motifs.append('within_window_state_dynamics') + operators.extend([self.classifier, 'hmm' if self.use_hmm else 'argmax']) + if self.use_hmm: + motifs.append('between_window_transition_smoothing') + return {'name': 'state_rocket_interval_hmm', 'route': 'cpu', 'operators': operators, 'motifs': motifs} + +@dataclass +class PosteriorCPUEnsemble(BaseEstimator, ClassifierMixin): + use_hmm: bool = True + seed: int = 42 + n_jobs: int = -1 + weights: tuple[float, ...] = (0.34, 0.33, 0.33) + members_: list[Any] = field(default_factory=list, init=False) + smoother_: TransitionSmoother | None = field(default=None, init=False) + classes_: NDArray[np.int64] | None = field(default=None, init=False) + trained_classes_: NDArray[np.int64] | None = field(default=None, init=False) + fit_seconds_: float = field(default=0.0, init=False) + + def fit(self, X: Any, y: Any, *, groups: Any | None=None, time_index: Any | None=None, n_classes: int | None=None) -> 'PosteriorCPUEnsemble': + start = time.perf_counter() + yy = np.asarray(y, dtype=np.int64) + self.classes_ = global_classes(yy, n_classes) + self.trained_classes_ = np.unique(yy) + self.members_ = [StateRocketIntervalHMM(n_kernels=256, n_intervals=16, use_hmm=False, seed=self.seed, n_jobs=self.n_jobs), InvariantIntervalShapeForest(n_shapelets=24, use_hmm=False, seed=self.seed + 1, n_jobs=self.n_jobs), SymbolicIntervalForest(use_hmm=False, seed=self.seed + 2, n_jobs=self.n_jobs)] + for member in self.members_: + member.fit(X, yy, groups=groups, time_index=time_index, n_classes=int(self.classes_.size)) + self.smoother_ = TransitionSmoother().fit(yy, groups=groups, time_index=time_index, n_classes=int(self.classes_.size)) if self.use_hmm else None + self.fit_seconds_ = time.perf_counter() - start + return self + + def predict_proba(self, X: Any) -> NDArray[np.float64]: + if not self.members_ or self.classes_ is None: + raise RuntimeError('Model is not fitted') + probs = [m.predict_proba(X) for m in self.members_] + w = np.asarray(self.weights, dtype=np.float64) + if w.size != len(probs): + w = np.ones((len(probs),), dtype=np.float64) + w = w / np.maximum(w.sum(), 1e-12) + out = sum((float(wi) * pi for wi, pi in zip(w, probs))) + return out / np.maximum(out.sum(axis=1, keepdims=True), 1e-12) + + def predict(self, X: Any, *, groups: Any | None=None, time_index: Any | None=None) -> NDArray[np.int64]: + P = self.predict_proba(X) + if self.smoother_ is not None and groups is not None: + return self.smoother_.predict_from_proba(P, groups=groups, time_index=time_index) + return labels_from_proba(P, self.classes_) + + def design_profile(self) -> dict[str, Any]: + return {'name': 'posterior_cpu_ensemble', 'route': 'cpu', 'operators': ['posterior_weighting', 'random_conv', 'invariant_physics', 'symbolic_transition', 'probability_ensemble', 'hmm' if self.use_hmm else 'argmax'], 'motifs': ['multi_view_cpu', 'posterior_over_motifs', 'state_dynamics', 'orientation_invariance', 'transition_smoothing']} + +def build_cpu_estimator(spec: dict[str, Any] | str) -> Any: + if isinstance(spec, str): + name = spec + params: dict[str, Any] = {} + else: + name = str(spec.get('name', spec.get('algorithm', 'har_sculpt_forest_hmm'))) + params = dict(spec.get('params', {})) + if name == 'har_sculpt_forest_hmm': + return HarSculptForestHMM(**params) + if name == 'rocket_sketch_ridge_hmm': + return RocketSketchRidgeHMM(**params) + if name == 'symbolic_interval_forest': + return SymbolicIntervalForest(**params) + if name == 'hybrid_cpu_ensemble': + return HybridCPUEnsemble(**params) + if name == 'invariant_interval_shape_forest': + return InvariantIntervalShapeForest(**params) + if name == 'state_rocket_interval_hmm': + return StateRocketIntervalHMM(**params) + if name == 'posterior_cpu_ensemble': + return PosteriorCPUEnsemble(**params) + raise ValueError(f'Unknown CPU estimator: {name}') + +def estimate_pickle_size_mb(model: Any) -> float: + return len(pickle.dumps(model)) / (1024.0 * 1024.0) diff --git a/src/wisp/core/__init__.py b/src/wisp/core/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/src/wisp/core/__init__.py @@ -0,0 +1 @@ + diff --git a/src/wisp/core/data.py b/src/wisp/core/data.py new file mode 100644 index 0000000000000000000000000000000000000000..aa098b35526edfdfa4d28a5883799fd20516740e --- /dev/null +++ b/src/wisp/core/data.py @@ -0,0 +1,109 @@ +# Paper-scoped implementation; see SOURCE_PROVENANCE.json. +from __future__ import annotations +from dataclasses import dataclass +from pathlib import Path +from typing import Any, Literal +import numpy as np +from numpy.typing import NDArray +from sklearn.model_selection import GroupShuffleSplit, StratifiedShuffleSplit, train_test_split +from sklearn.preprocessing import LabelEncoder + +@dataclass +class HARData: + X: NDArray[np.float64] + y: NDArray[np.int64] + subject: NDArray[Any] | None = None + dataset: NDArray[Any] | None = None + device: NDArray[Any] | None = None + time_index: NDArray[Any] | None = None + label_names: list[str] | None = None + source: str = 'unknown' + sampling_rate_hz: float | None = None + metadata: dict[str, Any] | None = None + + def __post_init__(self) -> None: + X = np.asarray(self.X, dtype=np.float64) + if X.ndim == 2: + X = X[:, :, None] + if X.ndim != 3: + raise ValueError(f'X must have shape (n,T,C) or (n,T); got {X.shape}') + y = np.asarray(self.y) + if y.ndim != 1 or y.shape[0] != X.shape[0]: + raise ValueError('y must be 1D and have same n as X') + self.X = X + self.y = y.astype(np.int64, copy=False) + n = X.shape[0] + for name in ('subject', 'dataset', 'device', 'time_index'): + val = getattr(self, name) + if val is not None and len(val) != n: + raise ValueError(f'{name} must have length n={n}') + + @property + def n_classes(self) -> int: + if self.label_names is not None: + return int(len(self.label_names)) + return int(np.max(self.y)) + 1 if self.y.size else 0 + + @property + def shape(self) -> tuple[int, int, int]: + return tuple((int(v) for v in self.X.shape)) + + def subset(self, idx: NDArray[np.int64] | list[int]) -> 'HARData': + idx_arr = np.asarray(idx, dtype=np.int64) + return HARData(X=self.X[idx_arr], y=self.y[idx_arr], subject=None if self.subject is None else np.asarray(self.subject)[idx_arr], dataset=None if self.dataset is None else np.asarray(self.dataset)[idx_arr], device=None if self.device is None else np.asarray(self.device)[idx_arr], time_index=None if self.time_index is None else np.asarray(self.time_index)[idx_arr], label_names=self.label_names, source=self.source, sampling_rate_hz=self.sampling_rate_hz, metadata=None if self.metadata is None else dict(self.metadata)) + +def _label_encode(y: NDArray[Any]) -> tuple[NDArray[np.int64], list[str]]: + if np.issubdtype(np.asarray(y).dtype, np.integer): + y_int = np.asarray(y, dtype=np.int64) + classes = [str(c) for c in sorted(np.unique(y_int).tolist())] + le = LabelEncoder().fit(y_int) + return (le.transform(y_int).astype(np.int64), [str(c) for c in le.classes_.tolist()]) + le = LabelEncoder().fit(np.asarray(y).astype(str)) + return (le.transform(np.asarray(y).astype(str)).astype(np.int64), [str(c) for c in le.classes_.tolist()]) + +def load_dataset(data: str | Path, *, synthetic_seed: int=42) -> HARData: + path = Path(data) + if not path.exists(): + raise FileNotFoundError(path) + if path.suffix.lower() != '.npz': + raise ValueError('Only .npz is supported by the native loader. Export WristHARBench to npz first.') + obj = np.load(path, allow_pickle=True) + if 'X' not in obj or 'y' not in obj: + raise ValueError('NPZ file must contain keys X and y') + raw_y = np.asarray(obj['y']) + if 'label_names' in obj and np.issubdtype(raw_y.dtype, np.integer): + y = raw_y.astype(np.int64, copy=False) + names = [str(x) for x in np.asarray(obj['label_names'], dtype=object).tolist()] + if y.size and (int(np.min(y)) < 0 or int(np.max(y)) >= len(names)): + raise ValueError('Integer y is incompatible with the supplied label_names vocabulary') + else: + y, names = _label_encode(raw_y) + + def opt(key: str) -> NDArray[Any] | None: + return obj[key] if key in obj else None + return HARData(X=np.asarray(obj['X'], dtype=np.float64), y=y, subject=opt('subject'), dataset=opt('dataset'), device=opt('device'), time_index=opt('time_index'), label_names=names, source=str(path), sampling_rate_hz=float(np.asarray(obj['sampling_rate_hz']).reshape(-1)[0]) if 'sampling_rate_hz' in obj else None, metadata=dict(np.asarray(obj['metadata'], dtype=object).reshape(-1)[0]) if 'metadata' in obj else None) + +def concatenate_har(*parts: HARData, source: str | None=None) -> HARData: + if not parts: + raise ValueError('At least one HARData object is required') + shape_tail = parts[0].X.shape[1:] + n_classes = parts[0].n_classes + label_names = parts[0].label_names + for part in parts[1:]: + if part.X.shape[1:] != shape_tail: + raise ValueError(f'Incompatible time/channel shape {part.X.shape[1:]} != {shape_tail}') + if part.n_classes != n_classes: + raise ValueError(f'Incompatible class vocabulary {part.n_classes} != {n_classes}') + if label_names is not None and part.label_names is not None and (part.label_names != label_names): + raise ValueError('label_names differ across HARData objects') + + def cat_optional(name: str) -> NDArray[Any] | None: + vals = [getattr(part, name) for part in parts] + if all((v is None for v in vals)): + return None + if any((v is None for v in vals)): + raise ValueError(f'Cannot concatenate partially missing {name}') + return np.concatenate([np.asarray(v) for v in vals], axis=0) + metadata = dict(parts[0].metadata or {}) + metadata['concatenated_sources'] = [part.source for part in parts] + return HARData(X=np.concatenate([part.X for part in parts], axis=0), y=np.concatenate([part.y for part in parts], axis=0), subject=cat_optional('subject'), dataset=cat_optional('dataset'), device=cat_optional('device'), time_index=cat_optional('time_index'), label_names=label_names, source=source or '+'.join((part.source for part in parts)), sampling_rate_hz=parts[0].sampling_rate_hz, metadata=metadata) diff --git a/src/wisp/core/metrics.py b/src/wisp/core/metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..bee8cc794b5bca237127abff910129209d09c1e8 --- /dev/null +++ b/src/wisp/core/metrics.py @@ -0,0 +1,30 @@ +# Paper-scoped implementation; see SOURCE_PROVENANCE.json. +from __future__ import annotations +from typing import Any +import numpy as np +from numpy.typing import NDArray +from sklearn.metrics import accuracy_score, balanced_accuracy_score, confusion_matrix, f1_score + +def classification_report_dict(y_true: NDArray[np.int64], y_pred: NDArray[np.int64], *, fit_seconds: float | None=None, predict_seconds: float | None=None, model_size_mb: float | None=None, label_names: list[str] | None=None) -> dict[str, Any]: + y_true = np.asarray(y_true, dtype=np.int64) + y_pred = np.asarray(y_pred, dtype=np.int64) + labels = np.unique(np.concatenate([y_true, y_pred])) if y_true.size else np.array([], dtype=np.int64) + per = f1_score(y_true, y_pred, average=None, labels=labels, zero_division=0) if labels.size else np.array([]) + out: dict[str, Any] = {'accuracy': float(accuracy_score(y_true, y_pred)) if y_true.size else float('nan'), 'balanced_accuracy': float(balanced_accuracy_score(y_true, y_pred)) if y_true.size else float('nan'), 'macro_f1': float(f1_score(y_true, y_pred, average='macro', zero_division=0)) if y_true.size else float('nan'), 'weighted_f1': float(f1_score(y_true, y_pred, average='weighted', zero_division=0)) if y_true.size else float('nan'), 'worst_class_f1': float(np.min(per)) if per.size else float('nan'), 'n': int(y_true.size), 'n_classes_seen': int(labels.size), 'per_class_f1': {str(int(k)): float(v) for k, v in zip(labels, per)}, 'confusion_matrix': confusion_matrix(y_true, y_pred, labels=labels).tolist() if labels.size else []} + if label_names is not None: + out['label_names'] = label_names + if fit_seconds is not None: + out['fit_seconds'] = float(fit_seconds) + if predict_seconds is not None: + out['predict_seconds'] = float(predict_seconds) + if model_size_mb is not None: + out['model_size_mb'] = float(model_size_mb) + return out + +def score_from_metrics(metrics: dict[str, Any], *, cost_weight: float=0.01, complexity: float=0.0) -> float: + macro = float(metrics.get('macro_f1', 0.0)) + worst = float(metrics.get('worst_class_f1', 0.0)) + fit_s = float(metrics.get('fit_seconds', 0.0)) + pred_s = float(metrics.get('predict_seconds', 0.0)) + cost_penalty = cost_weight * np.log1p(max(fit_s, 0.0) + 2.0 * max(pred_s, 0.0)) + return float(0.75 * macro + 0.25 * worst - cost_penalty - 0.002 * complexity) diff --git a/src/wisp/cpu/__init__.py b/src/wisp/cpu/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/src/wisp/cpu/__init__.py @@ -0,0 +1 @@ + diff --git a/src/wisp/cpu/algorithms.py b/src/wisp/cpu/algorithms.py new file mode 100644 index 0000000000000000000000000000000000000000..bad2e3301194c1c8482188e7d7e6847ece5d7354 --- /dev/null +++ b/src/wisp/cpu/algorithms.py @@ -0,0 +1,386 @@ +# Paper-scoped implementation; see SOURCE_PROVENANCE.json. +from __future__ import annotations +import pickle +import time +from dataclasses import dataclass, field +from typing import Any, Literal +import numpy as np +from numpy.typing import NDArray +from sklearn.base import BaseEstimator, ClassifierMixin, clone +from sklearn.ensemble import ExtraTreesClassifier, RandomForestClassifier +from sklearn.linear_model import LogisticRegression, RidgeClassifierCV +from sklearn.pipeline import Pipeline +from sklearn.preprocessing import StandardScaler +from sklearn.utils.class_weight import compute_sample_weight +from .features import IntervalDistributionSketch, InvariantPhysicsFeatureExtractor, RandomConvSketch, RandomShapeletSketch, WearableFeatureExtractor +from .hmm import TransitionSmoother +from .probability import estimator_proba, global_classes, labels_from_proba + +def _softmax(z: NDArray[np.float64]) -> NDArray[np.float64]: + z = np.asarray(z, dtype=np.float64) + z = z - np.max(z, axis=1, keepdims=True) + e = np.exp(z) + return e / np.sum(e, axis=1, keepdims=True) + +def _classifier(kind: str, *, seed: int, n_jobs: int=-1) -> Any: + if kind == 'extratrees': + return ExtraTreesClassifier(n_estimators=120, max_features='sqrt', min_samples_leaf=1, class_weight='balanced', random_state=seed, n_jobs=n_jobs) + if kind == 'rf': + return RandomForestClassifier(n_estimators=120, max_features='sqrt', min_samples_leaf=1, class_weight='balanced_subsample', random_state=seed, n_jobs=n_jobs) + if kind == 'logreg': + return LogisticRegression(C=2.0, max_iter=2000, class_weight='balanced', solver='lbfgs', random_state=seed) + if kind == 'ridge': + return RidgeClassifierCV(alphas=np.logspace(-3, 3, 9)) + raise ValueError(f'Unknown classifier kind: {kind}') + +class _HMMMixin: + use_hmm: bool + smoother_: TransitionSmoother | None + classes_: NDArray[np.int64] | None + trained_classes_: NDArray[np.int64] | None + + def _set_classes(self, y: Any, n_classes: int | None) -> None: + yy = np.asarray(y, dtype=np.int64) + self.classes_ = global_classes(yy, n_classes) + self.trained_classes_ = np.unique(yy) + + def _fit_smoother(self, y: NDArray[np.int64], groups: Any | None, time_index: Any | None) -> None: + self.smoother_ = None + if self.use_hmm: + if self.classes_ is None: + raise RuntimeError('Global class axis is not initialized') + self.smoother_ = TransitionSmoother().fit(y, groups=groups, time_index=time_index, n_classes=int(self.classes_.size)) + + def _maybe_smooth(self, proba: NDArray[np.float64], groups: Any | None, time_index: Any | None) -> NDArray[np.int64]: + if self.classes_ is None: + raise RuntimeError('Global class axis is not initialized') + if getattr(self, 'smoother_', None) is not None and groups is not None: + return self.smoother_.predict_from_proba(proba, groups=groups, time_index=time_index) + return labels_from_proba(proba, self.classes_) + +@dataclass +class HarSculptForestHMM(BaseEstimator, ClassifierMixin, _HMMMixin): + classifier: Literal['extratrees', 'rf', 'logreg'] = 'extratrees' + use_hmm: bool = True + segment_sizes: tuple[int, ...] = (4, 8, 16) + symbolic_bins: int = 6 + seed: int = 42 + n_jobs: int = -1 + feature_extractor_: WearableFeatureExtractor | None = field(default=None, init=False) + model_: Any = field(default=None, init=False) + smoother_: TransitionSmoother | None = field(default=None, init=False) + classes_: NDArray[np.int64] | None = field(default=None, init=False) + trained_classes_: NDArray[np.int64] | None = field(default=None, init=False) + fit_seconds_: float = field(default=0.0, init=False) + + def fit(self, X: Any, y: Any, *, groups: Any | None=None, time_index: Any | None=None, n_classes: int | None=None) -> 'HarSculptForestHMM': + start = time.perf_counter() + y = np.asarray(y, dtype=np.int64) + self._set_classes(y, n_classes) + self.feature_extractor_ = WearableFeatureExtractor(segment_sizes=self.segment_sizes, symbolic_bins=self.symbolic_bins) + F = self.feature_extractor_.fit_transform(X, y) + clf = _classifier(self.classifier, seed=self.seed, n_jobs=self.n_jobs) + if self.classifier == 'logreg': + self.model_ = Pipeline([('scale', StandardScaler()), ('clf', clf)]) + else: + self.model_ = clf + self.model_.fit(F, y) + self._fit_smoother(y, groups, time_index) + self.fit_seconds_ = time.perf_counter() - start + return self + + def predict_proba(self, X: Any) -> NDArray[np.float64]: + if self.model_ is None or self.feature_extractor_ is None or self.classes_ is None: + raise RuntimeError('Model is not fitted') + F = self.feature_extractor_.transform(X) + return estimator_proba(self.model_, F, self.classes_) + + def predict(self, X: Any, *, groups: Any | None=None, time_index: Any | None=None) -> NDArray[np.int64]: + return self._maybe_smooth(self.predict_proba(X), groups, time_index) + + def design_profile(self) -> dict[str, Any]: + return {'name': 'har_sculpt_forest_hmm', 'route': 'cpu', 'operators': ['zscore', 'magnitude', 'jerk', 'multiscale_interval_stats', 'fft_bandpower', 'autocorr', 'symbolic_transition', 'extratrees', 'hmm' if self.use_hmm else 'argmax'], 'motifs': ['orientation_invariance', 'local_periodicity', 'transition_smoothing', 'tail_class_bias']} + +@dataclass +class RocketSketchRidgeHMM(BaseEstimator, ClassifierMixin, _HMMMixin): + n_kernels: int = 384 + classifier: Literal['ridge', 'logreg'] = 'ridge' + use_hmm: bool = True + seed: int = 42 + n_jobs: int = -1 + sketch_: RandomConvSketch | None = field(default=None, init=False) + model_: Any = field(default=None, init=False) + smoother_: TransitionSmoother | None = field(default=None, init=False) + classes_: NDArray[np.int64] | None = field(default=None, init=False) + trained_classes_: NDArray[np.int64] | None = field(default=None, init=False) + fit_seconds_: float = field(default=0.0, init=False) + + def fit(self, X: Any, y: Any, *, groups: Any | None=None, time_index: Any | None=None, n_classes: int | None=None) -> 'RocketSketchRidgeHMM': + start = time.perf_counter() + y = np.asarray(y, dtype=np.int64) + self._set_classes(y, n_classes) + self.sketch_ = RandomConvSketch(n_kernels=self.n_kernels, random_state=self.seed) + F = self.sketch_.fit_transform(X, y) + clf = _classifier(self.classifier, seed=self.seed, n_jobs=self.n_jobs) + self.model_ = Pipeline([('scale', StandardScaler()), ('clf', clf)]) + sample_weight = compute_sample_weight('balanced', y) if self.classifier == 'ridge' else None + if sample_weight is not None: + self.model_.fit(F, y, clf__sample_weight=sample_weight) + else: + self.model_.fit(F, y) + self._fit_smoother(y, groups, time_index) + self.fit_seconds_ = time.perf_counter() - start + return self + + def predict_proba(self, X: Any) -> NDArray[np.float64]: + if self.model_ is None or self.sketch_ is None or self.classes_ is None: + raise RuntimeError('Model is not fitted') + F = self.sketch_.transform(X) + return estimator_proba(self.model_, F, self.classes_) + + def predict(self, X: Any, *, groups: Any | None=None, time_index: Any | None=None) -> NDArray[np.int64]: + return self._maybe_smooth(self.predict_proba(X), groups, time_index) + + def design_profile(self) -> dict[str, Any]: + return {'name': 'rocket_sketch_ridge_hmm', 'route': 'cpu', 'operators': ['zscore', 'random_conv', 'ppv_pool', 'ridge', 'hmm' if self.use_hmm else 'argmax'], 'motifs': ['phase_tolerant_local_shape', 'fast_cpu', 'transition_smoothing']} + +@dataclass +class SymbolicIntervalForest(BaseEstimator, ClassifierMixin, _HMMMixin): + use_hmm: bool = True + seed: int = 42 + n_jobs: int = -1 + feature_extractor_: WearableFeatureExtractor | None = field(default=None, init=False) + model_: Any = field(default=None, init=False) + smoother_: TransitionSmoother | None = field(default=None, init=False) + classes_: NDArray[np.int64] | None = field(default=None, init=False) + trained_classes_: NDArray[np.int64] | None = field(default=None, init=False) + fit_seconds_: float = field(default=0.0, init=False) + + def fit(self, X: Any, y: Any, *, groups: Any | None=None, time_index: Any | None=None, n_classes: int | None=None) -> 'SymbolicIntervalForest': + start = time.perf_counter() + y = np.asarray(y, dtype=np.int64) + self._set_classes(y, n_classes) + self.feature_extractor_ = WearableFeatureExtractor(include_raw_stats=True, include_magnitude=True, include_jerk=False, include_multiscale=True, segment_sizes=(5, 10, 20), include_spectral=False, include_autocorr=False, include_cross_channel=True, include_symbolic=True, symbolic_bins=8) + F = self.feature_extractor_.fit_transform(X, y) + self.model_ = ExtraTreesClassifier(n_estimators=160, max_features='sqrt', class_weight='balanced', random_state=self.seed, n_jobs=self.n_jobs) + self.model_.fit(F, y) + self._fit_smoother(y, groups, time_index) + self.fit_seconds_ = time.perf_counter() - start + return self + + def predict_proba(self, X: Any) -> NDArray[np.float64]: + if self.model_ is None or self.feature_extractor_ is None or self.classes_ is None: + raise RuntimeError('Model is not fitted') + F = self.feature_extractor_.transform(X) + return estimator_proba(self.model_, F, self.classes_) + + def predict(self, X: Any, *, groups: Any | None=None, time_index: Any | None=None) -> NDArray[np.int64]: + return self._maybe_smooth(self.predict_proba(X), groups, time_index) + + def design_profile(self) -> dict[str, Any]: + return {'name': 'symbolic_interval_forest', 'route': 'cpu', 'operators': ['segment', 'aggregate_stats', 'quantize', 'transition_histogram', 'forest', 'hmm' if self.use_hmm else 'argmax'], 'motifs': ['interpretable_symbols', 'micro_pattern', 'transition_smoothing']} + +@dataclass +class HybridCPUEnsemble(BaseEstimator, ClassifierMixin): + use_hmm: bool = True + seed: int = 42 + n_jobs: int = -1 + members_: list[Any] = field(default_factory=list, init=False) + classes_: NDArray[np.int64] | None = field(default=None, init=False) + trained_classes_: NDArray[np.int64] | None = field(default=None, init=False) + fit_seconds_: float = field(default=0.0, init=False) + + def fit(self, X: Any, y: Any, *, groups: Any | None=None, time_index: Any | None=None, n_classes: int | None=None) -> 'HybridCPUEnsemble': + start = time.perf_counter() + yy = np.asarray(y, dtype=np.int64) + self.classes_ = global_classes(yy, n_classes) + self.trained_classes_ = np.unique(yy) + self.members_ = [HarSculptForestHMM(classifier='extratrees', use_hmm=False, seed=self.seed, n_jobs=self.n_jobs), RocketSketchRidgeHMM(n_kernels=256, classifier='ridge', use_hmm=False, seed=self.seed + 1, n_jobs=self.n_jobs), SymbolicIntervalForest(use_hmm=False, seed=self.seed + 2, n_jobs=self.n_jobs)] + for m in self.members_: + m.fit(X, yy, groups=groups, time_index=time_index, n_classes=int(self.classes_.size)) + self.smoother_ = TransitionSmoother().fit(yy, groups=groups, time_index=time_index, n_classes=int(self.classes_.size)) if self.use_hmm else None + self.fit_seconds_ = time.perf_counter() - start + return self + + def predict_proba(self, X: Any) -> NDArray[np.float64]: + if not self.members_ or self.classes_ is None: + raise RuntimeError('Model is not fitted') + out = np.mean([m.predict_proba(X) for m in self.members_], axis=0) + return out / np.maximum(out.sum(axis=1, keepdims=True), 1e-12) + + def predict(self, X: Any, *, groups: Any | None=None, time_index: Any | None=None) -> NDArray[np.int64]: + P = self.predict_proba(X) + if getattr(self, 'smoother_', None) is not None and groups is not None: + return self.smoother_.predict_from_proba(P, groups=groups, time_index=time_index) + return labels_from_proba(P, self.classes_) + + def design_profile(self) -> dict[str, Any]: + return {'name': 'hybrid_cpu_ensemble', 'route': 'cpu', 'operators': ['feature_union', 'random_conv', 'symbolic', 'probability_average', 'hmm' if self.use_hmm else 'argmax'], 'motifs': ['multi_view_cpu', 'robustness_by_diversity', 'transition_smoothing']} + +@dataclass +class InvariantIntervalShapeForest(BaseEstimator, ClassifierMixin, _HMMMixin): + classifier: Literal['extratrees', 'rf', 'logreg'] = 'extratrees' + use_hmm: bool = True + segment_sizes: tuple[int, ...] = (4, 8, 16) + symbolic_bins: int = 6 + n_shapelets: int = 32 + seed: int = 42 + n_jobs: int = -1 + physics_: InvariantPhysicsFeatureExtractor | None = field(default=None, init=False) + shapelets_: RandomShapeletSketch | None = field(default=None, init=False) + model_: Any = field(default=None, init=False) + smoother_: TransitionSmoother | None = field(default=None, init=False) + classes_: NDArray[np.int64] | None = field(default=None, init=False) + trained_classes_: NDArray[np.int64] | None = field(default=None, init=False) + fit_seconds_: float = field(default=0.0, init=False) + + def fit(self, X: Any, y: Any, *, groups: Any | None=None, time_index: Any | None=None, n_classes: int | None=None) -> 'InvariantIntervalShapeForest': + start = time.perf_counter() + y = np.asarray(y, dtype=np.int64) + self._set_classes(y, n_classes) + self.physics_ = InvariantPhysicsFeatureExtractor(segment_sizes=self.segment_sizes, symbolic_bins=int(self.symbolic_bins), random_intervals=24, random_state=self.seed, include_axis_features=True).fit(X, y) + self.shapelets_ = RandomShapeletSketch(n_shapelets=int(self.n_shapelets), random_state=self.seed + 17).fit(X, y) + F = np.concatenate([self.physics_.transform(X), self.shapelets_.transform(X)], axis=1) + clf = _classifier(self.classifier, seed=self.seed, n_jobs=self.n_jobs) + self.model_ = Pipeline([('scale', StandardScaler()), ('clf', clf)]) if self.classifier == 'logreg' else clf + self.model_.fit(F, y) + self._fit_smoother(y, groups, time_index) + self.fit_seconds_ = time.perf_counter() - start + return self + + def _features(self, X: Any) -> NDArray[np.float64]: + if self.physics_ is None or self.shapelets_ is None: + raise RuntimeError('Model is not fitted') + return np.concatenate([self.physics_.transform(X), self.shapelets_.transform(X)], axis=1) + + def predict_proba(self, X: Any) -> NDArray[np.float64]: + if self.model_ is None or self.classes_ is None: + raise RuntimeError('Model is not fitted') + return estimator_proba(self.model_, self._features(X), self.classes_) + + def predict(self, X: Any, *, groups: Any | None=None, time_index: Any | None=None) -> NDArray[np.int64]: + return self._maybe_smooth(self.predict_proba(X), groups, time_index) + + def design_profile(self) -> dict[str, Any]: + return {'name': 'invariant_interval_shape_forest', 'route': 'cpu', 'operators': ['zscore', 'magnitude', 'jerk', 'gram_eig', 'dyadic_intervals', 'quantile_distribution', 'random_shapelet', 'extratrees', 'hmm' if self.use_hmm else 'argmax'], 'motifs': ['orientation_invariance', 'device_shift_robustness', 'interval_distribution', 'local_shape', 'transition_smoothing']} + +@dataclass +class StateRocketIntervalHMM(BaseEstimator, ClassifierMixin, _HMMMixin): + n_kernels: int = 384 + n_intervals: int = 24 + classifier: Literal['ridge', 'logreg'] = 'ridge' + use_hmm: bool = True + seed: int = 42 + n_jobs: int = -1 + rocket_: RandomConvSketch | None = field(default=None, init=False) + interval_: IntervalDistributionSketch | None = field(default=None, init=False) + state_: WearableFeatureExtractor | None = field(default=None, init=False) + model_: Any = field(default=None, init=False) + smoother_: TransitionSmoother | None = field(default=None, init=False) + classes_: NDArray[np.int64] | None = field(default=None, init=False) + trained_classes_: NDArray[np.int64] | None = field(default=None, init=False) + fit_seconds_: float = field(default=0.0, init=False) + + def fit(self, X: Any, y: Any, *, groups: Any | None=None, time_index: Any | None=None, n_classes: int | None=None) -> 'StateRocketIntervalHMM': + start = time.perf_counter() + y = np.asarray(y, dtype=np.int64) + self._set_classes(y, n_classes) + self.rocket_ = RandomConvSketch(n_kernels=int(self.n_kernels), random_state=self.seed).fit(X, y) + self.interval_ = IntervalDistributionSketch(n_random_intervals=int(self.n_intervals), random_state=self.seed + 29).fit(X, y) + self.state_ = WearableFeatureExtractor(include_raw_stats=False, include_magnitude=True, include_jerk=True, include_multiscale=False, include_spectral=True, include_autocorr=True, include_cross_channel=True, include_symbolic=True, symbolic_bins=6).fit(X, y) + F = self._features(X) + clf = _classifier(self.classifier, seed=self.seed, n_jobs=self.n_jobs) + self.model_ = Pipeline([('scale', StandardScaler()), ('clf', clf)]) + if self.classifier == 'ridge': + self.model_.fit(F, y, clf__sample_weight=compute_sample_weight('balanced', y)) + else: + self.model_.fit(F, y) + self._fit_smoother(y, groups, time_index) + self.fit_seconds_ = time.perf_counter() - start + return self + + def _features(self, X: Any) -> NDArray[np.float64]: + if self.rocket_ is None or self.interval_ is None or self.state_ is None: + raise RuntimeError('Model is not fitted') + return np.concatenate([self.rocket_.transform(X), self.interval_.transform(X), self.state_.transform(X)], axis=1) + + def predict_proba(self, X: Any) -> NDArray[np.float64]: + if self.model_ is None or self.classes_ is None: + raise RuntimeError('Model is not fitted') + return estimator_proba(self.model_, self._features(X), self.classes_) + + def predict(self, X: Any, *, groups: Any | None=None, time_index: Any | None=None) -> NDArray[np.int64]: + return self._maybe_smooth(self.predict_proba(X), groups, time_index) + + def design_profile(self) -> dict[str, Any]: + return {'name': 'state_rocket_interval_hmm', 'route': 'cpu', 'operators': ['zscore', 'random_conv', 'ppv_pool', 'dyadic_intervals', 'quantile_distribution', 'symbolic_transition', 'ridge', 'hmm' if self.use_hmm else 'argmax'], 'motifs': ['phase_tolerant_local_shape', 'interval_distribution', 'state_dynamics', 'fast_cpu', 'transition_smoothing']} + +@dataclass +class PosteriorCPUEnsemble(BaseEstimator, ClassifierMixin): + use_hmm: bool = True + seed: int = 42 + n_jobs: int = -1 + weights: tuple[float, ...] = (0.34, 0.33, 0.33) + members_: list[Any] = field(default_factory=list, init=False) + smoother_: TransitionSmoother | None = field(default=None, init=False) + classes_: NDArray[np.int64] | None = field(default=None, init=False) + trained_classes_: NDArray[np.int64] | None = field(default=None, init=False) + fit_seconds_: float = field(default=0.0, init=False) + + def fit(self, X: Any, y: Any, *, groups: Any | None=None, time_index: Any | None=None, n_classes: int | None=None) -> 'PosteriorCPUEnsemble': + start = time.perf_counter() + yy = np.asarray(y, dtype=np.int64) + self.classes_ = global_classes(yy, n_classes) + self.trained_classes_ = np.unique(yy) + self.members_ = [StateRocketIntervalHMM(n_kernels=256, n_intervals=16, use_hmm=False, seed=self.seed, n_jobs=self.n_jobs), InvariantIntervalShapeForest(n_shapelets=24, use_hmm=False, seed=self.seed + 1, n_jobs=self.n_jobs), SymbolicIntervalForest(use_hmm=False, seed=self.seed + 2, n_jobs=self.n_jobs)] + for member in self.members_: + member.fit(X, yy, groups=groups, time_index=time_index, n_classes=int(self.classes_.size)) + self.smoother_ = TransitionSmoother().fit(yy, groups=groups, time_index=time_index, n_classes=int(self.classes_.size)) if self.use_hmm else None + self.fit_seconds_ = time.perf_counter() - start + return self + + def predict_proba(self, X: Any) -> NDArray[np.float64]: + if not self.members_ or self.classes_ is None: + raise RuntimeError('Model is not fitted') + probs = [m.predict_proba(X) for m in self.members_] + w = np.asarray(self.weights, dtype=np.float64) + if w.size != len(probs): + w = np.ones((len(probs),), dtype=np.float64) + w = w / np.maximum(w.sum(), 1e-12) + out = sum((float(wi) * pi for wi, pi in zip(w, probs))) + return out / np.maximum(out.sum(axis=1, keepdims=True), 1e-12) + + def predict(self, X: Any, *, groups: Any | None=None, time_index: Any | None=None) -> NDArray[np.int64]: + P = self.predict_proba(X) + if self.smoother_ is not None and groups is not None: + return self.smoother_.predict_from_proba(P, groups=groups, time_index=time_index) + return labels_from_proba(P, self.classes_) + + def design_profile(self) -> dict[str, Any]: + return {'name': 'posterior_cpu_ensemble', 'route': 'cpu', 'operators': ['posterior_weighting', 'random_conv', 'invariant_physics', 'symbolic_transition', 'probability_ensemble', 'hmm' if self.use_hmm else 'argmax'], 'motifs': ['multi_view_cpu', 'posterior_over_motifs', 'state_dynamics', 'orientation_invariance', 'transition_smoothing']} + +def build_cpu_estimator(spec: dict[str, Any] | str) -> Any: + if isinstance(spec, str): + name = spec + params: dict[str, Any] = {} + else: + name = str(spec.get('name', spec.get('algorithm', 'har_sculpt_forest_hmm'))) + params = dict(spec.get('params', {})) + if name == 'har_sculpt_forest_hmm': + return HarSculptForestHMM(**params) + if name == 'rocket_sketch_ridge_hmm': + return RocketSketchRidgeHMM(**params) + if name == 'symbolic_interval_forest': + return SymbolicIntervalForest(**params) + if name == 'hybrid_cpu_ensemble': + return HybridCPUEnsemble(**params) + if name == 'invariant_interval_shape_forest': + return InvariantIntervalShapeForest(**params) + if name == 'state_rocket_interval_hmm': + return StateRocketIntervalHMM(**params) + if name == 'posterior_cpu_ensemble': + return PosteriorCPUEnsemble(**params) + raise ValueError(f'Unknown CPU estimator: {name}') + +def estimate_pickle_size_mb(model: Any) -> float: + return len(pickle.dumps(model)) / (1024.0 * 1024.0) diff --git a/src/wisp/cpu/features.py b/src/wisp/cpu/features.py new file mode 100644 index 0000000000000000000000000000000000000000..9ea057397a3181f774507d3b638a5904ff2dbf6d --- /dev/null +++ b/src/wisp/cpu/features.py @@ -0,0 +1,417 @@ +# Paper-scoped implementation; see SOURCE_PROVENANCE.json. +from __future__ import annotations +from dataclasses import dataclass, field +from typing import Any, Iterable, Sequence +import numpy as np +from numpy.typing import NDArray +from scipy.stats import kurtosis, skew +from sklearn.base import BaseEstimator, TransformerMixin + +def _as_3d(X: Any) -> NDArray[np.float64]: + arr = np.asarray(X, dtype=np.float64) + if arr.ndim == 2: + arr = arr[:, :, None] + if arr.ndim != 3: + raise ValueError(f'Expected X shape (n,T,C) or (n,T); got {arr.shape}') + return arr + +def _safe_zscore_per_window(X: NDArray[np.float64], eps: float=1e-06) -> NDArray[np.float64]: + mu = np.nanmean(X, axis=1, keepdims=True) + sd = np.nanstd(X, axis=1, keepdims=True) + sd = np.where(sd < eps, 1.0, sd) + return np.nan_to_num((X - mu) / sd, nan=0.0, posinf=0.0, neginf=0.0) + +def _slope(y: NDArray[np.float64]) -> NDArray[np.float64]: + T = y.shape[1] + t = np.arange(T, dtype=np.float64) + tc = t - t.mean() + denom = float(np.dot(tc, tc)) or 1.0 + yc = y - np.mean(y, axis=1, keepdims=True) + return np.einsum('t,ntc->nc', tc, yc) / denom + +def _zero_crossing_rate(X: NDArray[np.float64]) -> NDArray[np.float64]: + s = np.signbit(X) + return np.mean(s[:, 1:, :] != s[:, :-1, :], axis=1) + +def _segment_view(X: NDArray[np.float64], w: int) -> NDArray[np.float64]: + n, T, C = X.shape + if w <= 0: + raise ValueError('w must be positive') + seg_len = int(np.ceil(T / w)) + T2 = seg_len * w + if T2 != T: + pad = np.repeat(X[:, -1:, :], T2 - T, axis=1) + X = np.concatenate([X, pad], axis=1) + return X.reshape(n, w, seg_len, C) + +def _spectral_features(X: NDArray[np.float64], bands: Sequence[tuple[float, float]]) -> NDArray[np.float64]: + n, T, C = X.shape + x = X - np.mean(X, axis=1, keepdims=True) + fft = np.fft.rfft(x, axis=1) + power = np.abs(fft) ** 2 / max(T, 1) + freqs = np.fft.rfftfreq(T, d=1.0) + total = np.sum(power[:, 1:, :], axis=1) + 1e-12 if power.shape[1] > 1 else np.ones((n, C)) + feats: list[NDArray[np.float64]] = [] + for lo, hi in bands: + mask = (freqs >= lo) & (freqs < hi) + if not np.any(mask): + feats.append(np.zeros((n, C), dtype=np.float64)) + else: + feats.append(np.sum(power[:, mask, :], axis=1) / total) + p = power[:, 1:, :] / (total[:, None, :] if power.shape[1] > 1 else 1.0) + entropy = -np.sum(np.where(p > 0, p * np.log(p + 1e-12), 0.0), axis=1) / np.log(max(p.shape[1], 2)) if power.shape[1] > 1 else np.zeros((n, C)) + centroid = np.sum(freqs[1:, None] * power[:, 1:, :], axis=1) / total if power.shape[1] > 1 else np.zeros((n, C)) + peak = freqs[1:][np.argmax(power[:, 1:, :], axis=1)] if power.shape[1] > 1 else np.zeros((n, C)) + feats.extend([entropy, centroid, peak]) + return np.concatenate([f.reshape(n, -1) for f in feats], axis=1) + +def _autocorr_features(X: NDArray[np.float64], lags: Sequence[int]) -> NDArray[np.float64]: + n, T, C = X.shape + x = X - np.mean(X, axis=1, keepdims=True) + denom = np.sum(x * x, axis=1) + 1e-12 + feats = [] + for lag in lags: + if lag <= 0 or lag >= T: + feats.append(np.zeros((n, C), dtype=np.float64)) + else: + feats.append(np.sum(x[:, :-lag, :] * x[:, lag:, :], axis=1) / denom) + return np.concatenate([f.reshape(n, -1) for f in feats], axis=1) if feats else np.empty((n, 0)) + +def _transition_features(x: NDArray[np.float64], n_bins: int=6) -> NDArray[np.float64]: + n, T, C = x.shape + outs: list[NDArray[np.float64]] = [] + for c in range(C): + xc = x[:, :, c] + q = np.quantile(xc, np.linspace(0, 1, n_bins + 1)[1:-1], axis=1).T + states = np.sum(xc[:, :, None] > q[:, None, :], axis=2).astype(np.int64) + mat = np.zeros((n, n_bins, n_bins), dtype=np.float64) + for i in range(n): + np.add.at(mat[i], (states[i, :-1], states[i, 1:]), 1.0) + row = mat.sum(axis=2, keepdims=True) + mat = np.where(row > 0, mat / np.maximum(row, 1.0), 0.0) + hist = np.mean(np.eye(n_bins)[states], axis=1) + flat = mat.reshape(n, -1) + ent = -np.sum(np.where(flat > 0, flat * np.log(flat + 1e-12), 0.0), axis=1, keepdims=True) + outs.extend([hist, flat, ent]) + return np.concatenate(outs, axis=1) if outs else np.empty((n, 0)) + +@dataclass +class WearableFeatureExtractor(BaseEstimator, TransformerMixin): + zscore: bool = True + include_raw_stats: bool = True + include_magnitude: bool = True + include_jerk: bool = True + include_multiscale: bool = True + segment_sizes: tuple[int, ...] = (4, 8, 16) + include_spectral: bool = True + spectral_bands: tuple[tuple[float, float], ...] = ((0.0, 0.05), (0.05, 0.15), (0.15, 0.3), (0.3, 0.51)) + include_autocorr: bool = True + autocorr_lags: tuple[int, ...] = (1, 2, 4, 8, 16, 32) + include_cross_channel: bool = True + include_symbolic: bool = True + symbolic_bins: int = 6 + feature_names_: list[str] = field(default_factory=list, init=False) + + def fit(self, X: Any, y: Any | None=None) -> 'WearableFeatureExtractor': + self.transform(X[:min(len(X), 3)] if hasattr(X, '__len__') else X) + return self + + def transform(self, X: Any) -> NDArray[np.float64]: + X3 = _as_3d(X) + if self.zscore: + Xn = _safe_zscore_per_window(X3) + else: + Xn = np.nan_to_num(X3, nan=0.0, posinf=0.0, neginf=0.0) + variants = [Xn] + names_prefix = ['ch'] + if self.include_magnitude and Xn.shape[2] >= 2: + mag = np.linalg.norm(Xn[:, :, :min(3, Xn.shape[2])], axis=2, keepdims=True) + variants.append(mag) + names_prefix.append('mag') + if self.include_jerk: + jerk = np.diff(Xn, axis=1, prepend=Xn[:, :1, :]) + variants.append(jerk) + names_prefix.append('jerk') + if Xn.shape[2] >= 2: + variants.append(np.linalg.norm(jerk[:, :, :min(3, Xn.shape[2])], axis=2, keepdims=True)) + names_prefix.append('jerk_mag') + feat_blocks: list[NDArray[np.float64]] = [] + feature_names: list[str] = [] + for V, prefix in zip(variants, names_prefix): + n, T, C = V.shape + if self.include_raw_stats: + stats = [np.mean(V, axis=1), np.std(V, axis=1), np.min(V, axis=1), np.max(V, axis=1), np.median(V, axis=1), np.quantile(V, 0.25, axis=1), np.quantile(V, 0.75, axis=1), np.mean(V * V, axis=1), np.mean(np.diff(V, axis=1, prepend=V[:, :1, :]), axis=1), np.std(np.diff(V, axis=1, prepend=V[:, :1, :]), axis=1), _zero_crossing_rate(V), _slope(V), skew(V, axis=1, nan_policy='omit'), kurtosis(V, axis=1, nan_policy='omit')] + block = np.concatenate([np.nan_to_num(s).reshape(n, -1) for s in stats], axis=1) + feat_blocks.append(block) + feature_names.extend([f'{prefix}_stat_{i}' for i in range(block.shape[1])]) + if self.include_multiscale: + for w in self.segment_sizes: + if w > T: + continue + seg = _segment_view(V, int(w)) + means = np.mean(seg, axis=2).reshape(n, -1) + stds = np.std(seg, axis=2).reshape(n, -1) + rng = (np.max(seg, axis=2) - np.min(seg, axis=2)).reshape(n, -1) + slopes = [] + for j in range(int(w)): + slopes.append(_slope(seg[:, j, :, :])) + slopes_arr = np.stack(slopes, axis=1).reshape(n, -1) + block = np.concatenate([means, stds, rng, slopes_arr], axis=1) + feat_blocks.append(block) + feature_names.extend([f'{prefix}_seg{w}_{i}' for i in range(block.shape[1])]) + if self.include_spectral: + block = _spectral_features(V, self.spectral_bands) + feat_blocks.append(block) + feature_names.extend([f'{prefix}_fft_{i}' for i in range(block.shape[1])]) + if self.include_autocorr: + lags = tuple((l for l in self.autocorr_lags if l < T)) + block = _autocorr_features(V, lags) + feat_blocks.append(block) + feature_names.extend([f'{prefix}_acf_{i}' for i in range(block.shape[1])]) + if self.include_symbolic and V.shape[1] >= 8: + Vsym = V if V.shape[2] <= 3 else V[:, :, :3] + block = _transition_features(Vsym, n_bins=int(self.symbolic_bins)) + feat_blocks.append(block) + feature_names.extend([f'{prefix}_sym_{i}' for i in range(block.shape[1])]) + if self.include_cross_channel and Xn.shape[2] > 1: + n, _, C = Xn.shape + corr_feats = [] + for i in range(C): + for j in range(i + 1, C): + xi = Xn[:, :, i] - Xn[:, :, i].mean(axis=1, keepdims=True) + xj = Xn[:, :, j] - Xn[:, :, j].mean(axis=1, keepdims=True) + corr = np.sum(xi * xj, axis=1) / (np.sqrt(np.sum(xi * xi, axis=1) * np.sum(xj * xj, axis=1)) + 1e-12) + corr_feats.append(corr[:, None]) + if corr_feats: + block = np.concatenate(corr_feats, axis=1) + feat_blocks.append(block) + feature_names.extend([f'corr_{i}' for i in range(block.shape[1])]) + if not feat_blocks: + raise ValueError('No feature blocks enabled') + F = np.concatenate(feat_blocks, axis=1) + F = np.nan_to_num(F, nan=0.0, posinf=0.0, neginf=0.0).astype(np.float64, copy=False) + self.feature_names_ = feature_names + return F + +@dataclass +class RandomConvSketch(BaseEstimator, TransformerMixin): + n_kernels: int = 256 + kernel_lengths: tuple[int, ...] = (7, 9, 11, 15) + dilations: tuple[int, ...] = (1, 2, 4) + random_state: int = 42 + zscore: bool = True + kernels_: list[dict[str, Any]] = field(default_factory=list, init=False) + + def fit(self, X: Any, y: Any | None=None) -> 'RandomConvSketch': + X3 = _as_3d(X) + _, T, C = X3.shape + rng = np.random.default_rng(self.random_state) + kernels: list[dict[str, Any]] = [] + for _ in range(int(self.n_kernels)): + length = int(rng.choice(self.kernel_lengths)) + dilation = int(rng.choice(self.dilations)) + max_span = (length - 1) * dilation + 1 + if max_span > T: + dilation = max(1, (T - 1) // max(length - 1, 1)) + n_ch = int(rng.integers(1, min(C, 3) + 1)) + channels = np.sort(rng.choice(C, size=n_ch, replace=False)).astype(np.int64) + weights = rng.normal(0, 1, size=(length, n_ch)).astype(np.float64) + weights -= weights.mean(axis=0, keepdims=True) + norm = np.linalg.norm(weights) + 1e-12 + weights /= norm + bias = float(rng.normal(0, 0.25)) + kernels.append({'length': length, 'dilation': dilation, 'channels': channels, 'weights': weights, 'bias': bias}) + self.kernels_ = kernels + return self + + def transform(self, X: Any) -> NDArray[np.float64]: + X3 = _as_3d(X) + if self.zscore: + X3 = _safe_zscore_per_window(X3) + n, T, _ = X3.shape + feats = np.empty((n, len(self.kernels_) * 4), dtype=np.float64) + for k, spec in enumerate(self.kernels_): + length = int(spec['length']) + dilation = int(spec['dilation']) + channels = np.asarray(spec['channels'], dtype=np.int64) + weights = np.asarray(spec['weights'], dtype=np.float64) + span = (length - 1) * dilation + 1 + out_len = max(T - span + 1, 1) + resp = np.zeros((n, out_len), dtype=np.float64) + for ii in range(length): + start = ii * dilation + stop = start + out_len + resp += X3[:, start:stop, :][:, :, channels] @ weights[ii] + resp += float(spec['bias']) + feats[:, 4 * k + 0] = np.mean(resp > 0.0, axis=1) + feats[:, 4 * k + 1] = np.max(resp, axis=1) + feats[:, 4 * k + 2] = np.mean(resp, axis=1) + feats[:, 4 * k + 3] = np.std(resp, axis=1) + return np.nan_to_num(feats, nan=0.0, posinf=0.0, neginf=0.0) + +def _quantile_block(X: NDArray[np.float64], qs: Sequence[float]) -> NDArray[np.float64]: + q = np.quantile(X, np.asarray(qs, dtype=np.float64), axis=1).transpose(1, 2, 0) + return q.reshape(X.shape[0], -1) + +def _gram_eig_features(X: NDArray[np.float64]) -> NDArray[np.float64]: + n, _, c = X.shape + feats = [] + for i in range(n): + Xi = X[i] - X[i].mean(axis=0, keepdims=True) + G = Xi.T @ Xi / max(Xi.shape[0] - 1, 1) + vals = np.linalg.eigvalsh(G) + vals = np.sort(np.maximum(vals, 0.0))[::-1] + total = float(np.sum(vals)) + 1e-12 + ratios = vals / total + pad = np.zeros((max(6 - 2 * c, 0),), dtype=np.float64) + feats.append(np.concatenate([vals, ratios, pad], axis=0)) + return np.stack(feats, axis=0) + +@dataclass +class IntervalDistributionSketch(BaseEstimator, TransformerMixin): + n_random_intervals: int = 32 + random_state: int = 42 + quantiles: tuple[float, ...] = (0.1, 0.25, 0.5, 0.75, 0.9) + include_dyadic: bool = True + zscore: bool = True + intervals_: list[tuple[int, int]] = field(default_factory=list, init=False) + + def fit(self, X: Any, y: Any | None=None) -> 'IntervalDistributionSketch': + X3 = _as_3d(X) + _, T, _ = X3.shape + rng = np.random.default_rng(self.random_state) + intervals: list[tuple[int, int]] = [] + if self.include_dyadic: + for parts in (2, 4, 8): + width = max(2, int(np.ceil(T / parts))) + for start in range(0, T, width): + stop = min(T, start + width) + if stop - start >= 2: + intervals.append((start, stop)) + for _ in range(int(self.n_random_intervals)): + lo = int(rng.integers(0, max(T - 2, 1))) + max_len = max(3, T - lo) + length = int(rng.integers(2, max_len + 1)) + hi = min(T, lo + length) + if hi - lo >= 2: + intervals.append((lo, hi)) + seen: set[tuple[int, int]] = set() + self.intervals_ = [] + for it in intervals: + if it not in seen: + seen.add(it) + self.intervals_.append(it) + return self + + def transform(self, X: Any) -> NDArray[np.float64]: + X3 = _as_3d(X) + if self.zscore: + X3 = _safe_zscore_per_window(X3) + blocks: list[NDArray[np.float64]] = [] + for lo, hi in self.intervals_: + V = X3[:, lo:hi, :] + n = V.shape[0] + stats = [np.mean(V, axis=1), np.std(V, axis=1), np.max(V, axis=1) - np.min(V, axis=1), np.mean(V * V, axis=1), _slope(V), _quantile_block(V, self.quantiles)] + blocks.append(np.concatenate([s.reshape(n, -1) for s in stats], axis=1)) + if not blocks: + return np.empty((X3.shape[0], 0), dtype=np.float64) + return np.nan_to_num(np.concatenate(blocks, axis=1), nan=0.0, posinf=0.0, neginf=0.0) + +@dataclass +class InvariantPhysicsFeatureExtractor(BaseEstimator, TransformerMixin): + segment_sizes: tuple[int, ...] = (4, 8, 16) + symbolic_bins: int = 6 + random_intervals: int = 24 + random_state: int = 42 + zscore: bool = True + include_axis_features: bool = True + interval_: IntervalDistributionSketch | None = field(default=None, init=False) + + def fit(self, X: Any, y: Any | None=None) -> 'InvariantPhysicsFeatureExtractor': + X3 = _as_3d(X) + self.interval_ = IntervalDistributionSketch(n_random_intervals=self.random_intervals, random_state=self.random_state, zscore=self.zscore).fit(X3, y) + return self + + def transform(self, X: Any) -> NDArray[np.float64]: + X3 = _as_3d(X) + Xn = _safe_zscore_per_window(X3) if self.zscore else np.nan_to_num(X3) + n, T, C = Xn.shape + blocks: list[NDArray[np.float64]] = [] + if self.include_axis_features: + axis = WearableFeatureExtractor(zscore=False, include_raw_stats=True, include_magnitude=False, include_jerk=False, include_multiscale=True, segment_sizes=self.segment_sizes, include_spectral=False, include_autocorr=False, include_cross_channel=True, include_symbolic=False).fit_transform(Xn) + blocks.append(axis) + base = Xn[:, :, :min(3, C)] + mag = np.linalg.norm(base, axis=2, keepdims=True) + jerk = np.diff(base, axis=1, prepend=base[:, :1, :]) + jerk_mag = np.linalg.norm(jerk, axis=2, keepdims=True) + invariant_series = np.concatenate([mag, jerk_mag], axis=2) + inv = WearableFeatureExtractor(zscore=False, include_raw_stats=True, include_magnitude=False, include_jerk=False, include_multiscale=True, segment_sizes=self.segment_sizes, include_spectral=True, include_autocorr=True, include_cross_channel=False, include_symbolic=True, symbolic_bins=self.symbolic_bins).fit_transform(invariant_series) + blocks.append(inv) + blocks.append(_gram_eig_features(base)) + mag_energy = np.mean(mag * mag, axis=1) + 1e-12 + jerk_energy = np.mean(jerk_mag * jerk_mag, axis=1) + blocks.append((jerk_energy / mag_energy).reshape(n, -1)) + if self.interval_ is not None: + blocks.append(self.interval_.transform(Xn)) + return np.nan_to_num(np.concatenate(blocks, axis=1), nan=0.0, posinf=0.0, neginf=0.0) + +@dataclass +class RandomShapeletSketch(BaseEstimator, TransformerMixin): + n_shapelets: int = 48 + lengths: tuple[int, ...] = (8, 12, 16, 24) + dilations: tuple[int, ...] = (1, 2, 4) + random_state: int = 42 + zscore: bool = True + shapelets_: list[dict[str, Any]] = field(default_factory=list, init=False) + + def fit(self, X: Any, y: Any | None=None) -> 'RandomShapeletSketch': + X3 = _as_3d(X) + if self.zscore: + X3 = _safe_zscore_per_window(X3) + n, T, C = X3.shape + rng = np.random.default_rng(self.random_state) + self.shapelets_ = [] + for _ in range(int(self.n_shapelets)): + length = int(rng.choice(self.lengths)) + dilation = int(rng.choice(self.dilations)) + span = (length - 1) * dilation + 1 + if span > T: + dilation = max(1, (T - 1) // max(length - 1, 1)) + span = (length - 1) * dilation + 1 + i = int(rng.integers(0, n)) + c = int(rng.integers(0, C)) + start = int(rng.integers(0, max(T - span + 1, 1))) + values = X3[i, start:start + span:dilation, c].astype(np.float64, copy=True) + values = values - float(values.mean()) + sd = float(values.std()) or 1.0 + values = values / sd + self.shapelets_.append({'values': values, 'channel': c, 'dilation': dilation}) + return self + + def transform(self, X: Any) -> NDArray[np.float64]: + X3 = _as_3d(X) + if self.zscore: + X3 = _safe_zscore_per_window(X3) + n, T, _ = X3.shape + F = np.empty((n, len(self.shapelets_) * 2), dtype=np.float64) + for k, spec in enumerate(self.shapelets_): + sh = np.asarray(spec['values'], dtype=np.float64) + c = int(spec['channel']) + dilation = int(spec['dilation']) + length = int(sh.shape[0]) + span = (length - 1) * dilation + 1 + out_len = max(T - span + 1, 1) + best = np.full((n,), np.inf, dtype=np.float64) + best_pos = np.zeros((n,), dtype=np.float64) + for start in range(out_len): + seg = X3[:, start:start + span:dilation, c] + seg = seg - seg.mean(axis=1, keepdims=True) + seg_sd = seg.std(axis=1, keepdims=True) + seg = seg / np.where(seg_sd < 1e-06, 1.0, seg_sd) + d = np.sqrt(np.mean((seg - sh[None, :]) ** 2, axis=1)) + improved = d < best + best = np.where(improved, d, best) + best_pos = np.where(improved, start / max(out_len - 1, 1), best_pos) + F[:, 2 * k] = best + F[:, 2 * k + 1] = best_pos + return np.nan_to_num(F, nan=0.0, posinf=0.0, neginf=0.0) diff --git a/src/wisp/cpu/hmm.py b/src/wisp/cpu/hmm.py new file mode 100644 index 0000000000000000000000000000000000000000..56fafc228baea6aea4cf950309a2316a310521e0 --- /dev/null +++ b/src/wisp/cpu/hmm.py @@ -0,0 +1,84 @@ +# Paper-scoped implementation; see SOURCE_PROVENANCE.json. +from __future__ import annotations +from dataclasses import dataclass +from typing import Any +import numpy as np +from numpy.typing import NDArray + +@dataclass +class TransitionSmoother: + alpha: float = 1.0 + persistence_boost: float = 2.0 + transition_: NDArray[np.float64] | None = None + prior_: NDArray[np.float64] | None = None + + def fit(self, y: NDArray[np.int64], *, groups: Any | None=None, time_index: Any | None=None, n_classes: int | None=None) -> 'TransitionSmoother': + y = np.asarray(y, dtype=np.int64) + if y.size == 0: + raise ValueError('Cannot fit smoother with empty y') + K = int(n_classes) if n_classes is not None else int(np.max(y)) + 1 + if K <= int(np.max(y)): + raise ValueError(f'n_classes={K} is incompatible with maximum label {int(np.max(y))}') + A = np.full((K, K), float(self.alpha), dtype=np.float64) + pi = np.bincount(y, minlength=K).astype(np.float64) + float(self.alpha) + if groups is not None: + groups_arr = np.asarray(groups) + order = np.arange(y.size) + if time_index is not None: + time_arr = np.asarray(time_index) + order = np.lexsort((time_arr, groups_arr)) + for g in np.unique(groups_arr): + idx = order[groups_arr[order] == g] + if idx.size > 1: + prev = y[idx[:-1]] + nxt = y[idx[1:]] + np.add.at(A, (prev, nxt), 1.0) + else: + A += np.eye(K) * float(self.persistence_boost) + A += np.eye(K) * float(self.persistence_boost) + self.transition_ = A / A.sum(axis=1, keepdims=True) + self.prior_ = pi / pi.sum() + return self + + def smooth_proba(self, proba: NDArray[np.float64], *, groups: Any | None=None, time_index: Any | None=None) -> NDArray[np.float64]: + yhat = self.predict_from_proba(proba, groups=groups, time_index=time_index) + K = proba.shape[1] + return np.eye(K, dtype=np.float64)[yhat] + + def predict_from_proba(self, proba: NDArray[np.float64], *, groups: Any | None=None, time_index: Any | None=None) -> NDArray[np.int64]: + if self.transition_ is None or self.prior_ is None: + raise RuntimeError('TransitionSmoother is not fitted') + P = np.asarray(proba, dtype=np.float64) + P = np.clip(P, 1e-12, 1.0) + P = P / P.sum(axis=1, keepdims=True) + n = P.shape[0] + out = np.empty((n,), dtype=np.int64) + if groups is None: + return self._viterbi(P) + groups_arr = np.asarray(groups) + order = np.arange(n) + if time_index is not None: + time_arr = np.asarray(time_index) + order = np.lexsort((time_arr, groups_arr)) + for g in np.unique(groups_arr): + idx = order[groups_arr[order] == g] + out[idx] = self._viterbi(P[idx]) + return out + + def _viterbi(self, P: NDArray[np.float64]) -> NDArray[np.int64]: + A = np.log(np.clip(self.transition_, 1e-12, 1.0)) + pi = np.log(np.clip(self.prior_, 1e-12, 1.0)) + E = np.log(np.clip(P, 1e-12, 1.0)) + T, K = E.shape + dp = np.empty((T, K), dtype=np.float64) + back = np.zeros((T, K), dtype=np.int64) + dp[0] = pi + E[0] + for t in range(1, T): + score = dp[t - 1][:, None] + A + back[t] = np.argmax(score, axis=0) + dp[t] = np.max(score, axis=0) + E[t] + path = np.empty((T,), dtype=np.int64) + path[-1] = int(np.argmax(dp[-1])) + for t in range(T - 2, -1, -1): + path[t] = back[t + 1, path[t + 1]] + return path diff --git a/src/wisp/cpu/probability.py b/src/wisp/cpu/probability.py new file mode 100644 index 0000000000000000000000000000000000000000..38d09b5f3b553fe0f2aec429a943579318ce520a --- /dev/null +++ b/src/wisp/cpu/probability.py @@ -0,0 +1,83 @@ +# Paper-scoped implementation; see SOURCE_PROVENANCE.json. +from __future__ import annotations +from typing import Any +import numpy as np +from numpy.typing import NDArray + +def global_classes(y: Any, n_classes: int | None=None) -> NDArray[np.int64]: + yy = np.asarray(y, dtype=np.int64) + if yy.size == 0: + raise ValueError('Cannot infer classes from an empty target array') + if np.min(yy) < 0: + raise ValueError('Class labels must be non-negative integer IDs') + k = int(n_classes) if n_classes is not None else int(np.max(yy)) + 1 + if k <= int(np.max(yy)): + raise ValueError(f'n_classes={k} is incompatible with maximum label {int(np.max(yy))}') + return np.arange(k, dtype=np.int64) + +def estimator_classes(estimator: Any) -> NDArray[np.int64]: + classes = getattr(estimator, 'classes_', None) + if classes is None and hasattr(estimator, 'named_steps'): + final = list(estimator.named_steps.values())[-1] + classes = getattr(final, 'classes_', None) + if classes is None: + raise AttributeError('Estimator does not expose classes_; probability columns cannot be aligned safely') + return np.asarray(classes, dtype=np.int64) + +def decision_to_proba(decision: Any, source_classes: Any) -> NDArray[np.float64]: + z = np.asarray(decision, dtype=np.float64) + classes = np.asarray(source_classes, dtype=np.int64) + if z.ndim == 1: + if classes.size != 2: + raise ValueError('A one-dimensional decision function is only valid for two classes') + z = np.stack([-z, z], axis=1) + if z.ndim != 2 or z.shape[1] != classes.size: + raise ValueError(f'Decision-function shape {z.shape} does not match source classes {classes.tolist()}') + z = z - np.max(z, axis=1, keepdims=True) + e = np.exp(z) + return e / np.maximum(e.sum(axis=1, keepdims=True), 1e-12) + +def align_proba(proba: Any, source_classes: Any, target_classes: Any, *, normalize: bool=True) -> NDArray[np.float64]: + p = np.asarray(proba, dtype=np.float64) + src = np.asarray(source_classes, dtype=np.int64) + dst = np.asarray(target_classes, dtype=np.int64) + if p.ndim != 2: + raise ValueError(f'Expected a 2-D probability matrix, got {p.shape}') + if p.shape[1] != src.size: + raise ValueError(f'Probability width {p.shape[1]} != number of source classes {src.size}') + if len(np.unique(src)) != src.size or len(np.unique(dst)) != dst.size: + raise ValueError('Class IDs must be unique') + lookup = {int(c): j for j, c in enumerate(dst)} + out = np.zeros((p.shape[0], dst.size), dtype=np.float64) + for j, c in enumerate(src): + if int(c) not in lookup: + raise ValueError(f'Estimator emitted unknown class ID {int(c)}') + out[:, lookup[int(c)]] = p[:, j] + out = np.clip(out, 0.0, np.inf) + if normalize: + denom = out.sum(axis=1, keepdims=True) + zero = denom[:, 0] <= 0 + if np.any(zero): + out[zero] = 1.0 / max(dst.size, 1) + denom = out.sum(axis=1, keepdims=True) + out /= denom + return out + +def estimator_proba(estimator: Any, features: Any, target_classes: Any) -> NDArray[np.float64]: + src = estimator_classes(estimator) + if hasattr(estimator, 'predict_proba'): + local = np.asarray(estimator.predict_proba(features), dtype=np.float64) + elif hasattr(estimator, 'decision_function'): + local = decision_to_proba(estimator.decision_function(features), src) + else: + pred = np.asarray(estimator.predict(features), dtype=np.int64) + local = np.zeros((pred.size, src.size), dtype=np.float64) + src_lookup = {int(c): i for i, c in enumerate(src)} + for i, c in enumerate(pred): + local[i, src_lookup[int(c)]] = 1.0 + return align_proba(local, src, target_classes) + +def labels_from_proba(proba: Any, target_classes: Any) -> NDArray[np.int64]: + p = np.asarray(proba, dtype=np.float64) + classes = np.asarray(target_classes, dtype=np.int64) + return classes[np.argmax(p, axis=1)].astype(np.int64) diff --git a/src/wisp/registry.py b/src/wisp/registry.py new file mode 100644 index 0000000000000000000000000000000000000000..4f5a10e6ba30cc0098f618410f35be63f8759d16 --- /dev/null +++ b/src/wisp/registry.py @@ -0,0 +1,60 @@ +# Paper-scoped implementation; see SOURCE_PROVENANCE.json. +from __future__ import annotations +from dataclasses import asdict, dataclass +from typing import Any, Callable, Literal +from wisp.cpu.algorithms import HarSculptForestHMM, HybridCPUEnsemble, InvariantIntervalShapeForest, PosteriorCPUEnsemble, RocketSketchRidgeHMM, StateRocketIntervalHMM, SymbolicIntervalForest +MethodGroup = Literal['base', 'composite'] + +@dataclass(frozen=True) +class MethodSpec: + method_id: str + paper_name: str + code_class: str + group: MethodGroup + family_index: int + params: dict[str, Any] + representation_scope: str + + def to_dict(self) -> dict[str, Any]: + return asdict(self) +_CANONICAL_SPECS: tuple[MethodSpec, ...] = (MethodSpec(method_id='wisp_ss', paper_name='WISP-SS', code_class='HarSculptForestHMM', group='base', family_index=1, params={'classifier': 'extratrees', 'use_hmm': True, 'segment_sizes': (4, 8, 16), 'symbolic_bins': 6}, representation_scope='global/multiscale statistics, relative spectrum, autocorrelation, symbolic transitions, cross-axis correlation'), MethodSpec(method_id='wisp_rc', paper_name='WISP-RC', code_class='RocketSketchRidgeHMM', group='base', family_index=2, params={'n_kernels': 384, 'classifier': 'ridge', 'use_hmm': True}, representation_scope='random dilated multichannel convolutions with PPV/max/mean/std pooling'), MethodSpec(method_id='wisp_so', paper_name='WISP-SO', code_class='SymbolicIntervalForest', group='base', family_index=3, params={'use_hmm': True}, representation_scope='per-window quantile states, transition matrices, fixed multiscale segment summaries'), MethodSpec(method_id='wisp_cse', paper_name='WISP-CSE', code_class='HybridCPUEnsemble', group='composite', family_index=4, params={'use_hmm': True}, representation_scope='score-level equal fusion of F1, F2 and F3 followed by one optional HMM'), MethodSpec(method_id='wisp_gis', paper_name='WISP-GIS', code_class='InvariantIntervalShapeForest', group='base', family_index=5, params={'classifier': 'extratrees', 'use_hmm': True, 'segment_sizes': (4, 8, 16), 'symbolic_bins': 6, 'n_shapelets': 32}, representation_scope='axis-dependent statistics plus axis-reduced geometry, interval distributions and random local-shape prototypes'), MethodSpec(method_id='wisp_cis', paper_name='WISP-CIS', code_class='StateRocketIntervalHMM', group='base', family_index=6, params={'n_kernels': 384, 'n_intervals': 24, 'classifier': 'ridge', 'use_hmm': True}, representation_scope='random convolution, interval distribution, within-window state summaries and optional across-window HMM'), MethodSpec(method_id='wisp_ese', paper_name='WISP-ESE', code_class='PosteriorCPUEnsemble', group='composite', family_index=7, params={'use_hmm': True, 'weights': (0.34, 0.33, 0.33)}, representation_scope='score-level weighted fusion of fixed F6, F5 and F3 members followed by one optional HMM')) +SPEC_BY_ID = {spec.method_id: spec for spec in _CANONICAL_SPECS} +CANONICAL_METHOD_IDS = tuple((spec.method_id for spec in _CANONICAL_SPECS)) +BASE_METHOD_IDS = tuple((spec.method_id for spec in _CANONICAL_SPECS if spec.group == 'base')) +COMPOSITE_METHOD_IDS = tuple((spec.method_id for spec in _CANONICAL_SPECS if spec.group == 'composite')) +_BUILDERS: dict[str, Callable[..., Any]] = {'HarSculptForestHMM': HarSculptForestHMM, 'RocketSketchRidgeHMM': RocketSketchRidgeHMM, 'SymbolicIntervalForest': SymbolicIntervalForest, 'HybridCPUEnsemble': HybridCPUEnsemble, 'InvariantIntervalShapeForest': InvariantIntervalShapeForest, 'StateRocketIntervalHMM': StateRocketIntervalHMM, 'PosteriorCPUEnsemble': PosteriorCPUEnsemble} + +def list_specs() -> tuple[MethodSpec, ...]: + return _CANONICAL_SPECS + +def get_spec(method_id: str) -> MethodSpec: + try: + return SPEC_BY_ID[method_id] + except KeyError as exc: + raise KeyError(f'Unknown method_id={method_id!r}; expected one of {sorted(SPEC_BY_ID)}') from exc + +def _tupleize_params(params: dict[str, Any]) -> dict[str, Any]: + out = dict(params) + for key in ('segment_sizes', 'weights'): + if key in out and isinstance(out[key], list): + out[key] = tuple(out[key]) + return out + +def build_method(method_id: str, *, seed: int, n_jobs: int=1, overrides: dict[str, Any] | None=None) -> Any: + spec = get_spec(method_id) + params = _tupleize_params(spec.params) + if overrides: + params.update(_tupleize_params(overrides)) + params['seed'] = int(seed) + params['n_jobs'] = int(n_jobs) + return _BUILDERS[spec.code_class](**params) + +def resolved_spec(method_id: str, *, seed: int, n_jobs: int, overrides: dict[str, Any] | None=None) -> dict[str, Any]: + spec = get_spec(method_id) + params = _tupleize_params(spec.params) + if overrides: + params.update(_tupleize_params(overrides)) + params.update({'seed': int(seed), 'n_jobs': int(n_jobs)}) + payload = spec.to_dict() + payload['params'] = params + return payload diff --git a/src/wisp/search/__init__.py b/src/wisp/search/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/src/wisp/search/__init__.py @@ -0,0 +1 @@ + diff --git a/src/wisp/search/cascade.py b/src/wisp/search/cascade.py new file mode 100644 index 0000000000000000000000000000000000000000..3ec8fddc93b3c717dffc54397faee20110a21542 --- /dev/null +++ b/src/wisp/search/cascade.py @@ -0,0 +1,114 @@ +# Paper-scoped implementation; see SOURCE_PROVENANCE.json. +from __future__ import annotations +import time +from dataclasses import asdict, dataclass +from typing import Any +import numpy as np +from wisp.core.data import HARData +from wisp.core.metrics import classification_report_dict, score_from_metrics +from wisp.cpu.algorithms import build_cpu_estimator, estimate_pickle_size_mb +from wisp.search.grammar import CPU_FAMILIES, CandidateSpec, normalize_spec +from wisp.search.operator_program import TemporalProgram + +@dataclass +class StageResult: + name: str + passed: bool + metrics: dict[str, Any] + message: str = '' + + def to_dict(self) -> dict[str, Any]: + return asdict(self) + +@dataclass +class CascadeResult: + accepted: bool + cascade_score: float + stages: list[StageResult] + result: dict[str, Any] + + def to_dict(self) -> dict[str, Any]: + out = dict(self.result) + out['accepted'] = bool(self.accepted) + out['cascade_score'] = float(self.cascade_score) + out['cascade_stages'] = [s.to_dict() for s in self.stages] + return out + +def validate_candidate_spec(spec: CandidateSpec) -> StageResult: + spec = normalize_spec(spec) + if spec.route != 'cpu': + return StageResult('spec_validity', False, {}, "v2 CPU evaluator only accepts route='cpu'.") + if spec.name not in CPU_FAMILIES: + return StageResult('spec_validity', False, {}, f'unknown CPU family: {spec.name}') + p = spec.params + if 'n_kernels' in p and (not 8 <= int(p['n_kernels']) <= 4096): + return StageResult('spec_validity', False, {}, 'n_kernels outside allowed range') + if 'n_shapelets' in p and (not 4 <= int(p['n_shapelets']) <= 512): + return StageResult('spec_validity', False, {}, 'n_shapelets outside allowed range') + if 'symbolic_bins' in p and (not 2 <= int(p['symbolic_bins']) <= 32): + return StageResult('spec_validity', False, {}, 'symbolic_bins outside allowed range') + return StageResult('spec_validity', True, TemporalProgram.from_candidate(spec).certificate()) + +def _axis_sign_flip(X: np.ndarray) -> np.ndarray: + out = X.copy() + if out.shape[2] >= 3: + out[:, :, 0] *= -1.0 + out[:, :, 2] *= -1.0 + return out + +def _time_shift(X: np.ndarray) -> np.ndarray: + return np.roll(X, shift=max(1, X.shape[1] // 20), axis=1) + +def _channel_dropout(X: np.ndarray) -> np.ndarray: + out = X.copy() + if out.shape[2] > 1: + out[:, :, -1] = 0.0 + return out + +def _noise(X: np.ndarray) -> np.ndarray: + rng = np.random.default_rng(12345) + scale = np.nanstd(X, axis=(1, 2), keepdims=True) * 0.05 + return X + rng.normal(0.0, 1.0, size=X.shape) * scale +STRESS_TRANSFORMS = {'axis_sign_flip': _axis_sign_flip, 'time_shift': _time_shift, 'channel_dropout': _channel_dropout, 'sensor_noise': _noise} + +def evaluate_candidate_cascade(spec: CandidateSpec, train: HARData, valid: HARData, *, cost_weight: float=0.01, robustness_weight: float=0.1, max_stress_transforms: int=4) -> CascadeResult: + spec = normalize_spec(spec) + stages: list[StageResult] = [] + valid_stage = validate_candidate_spec(spec) + stages.append(valid_stage) + if not valid_stage.passed: + return CascadeResult(False, -1000000000.0, stages, {'candidate': spec.to_dict(), 'score': -1000000000.0}) + model = build_cpu_estimator(spec.to_dict()) + t0 = time.perf_counter() + model.fit(train.X, train.y, groups=train.subject, time_index=train.time_index, n_classes=train.n_classes) + fit_s = time.perf_counter() - t0 + t1 = time.perf_counter() + pred = model.predict(valid.X, groups=valid.subject, time_index=valid.time_index) + pred_s = time.perf_counter() - t1 + size_mb = estimate_pickle_size_mb(model) + metrics = classification_report_dict(valid.y, pred, fit_seconds=fit_s, predict_seconds=pred_s, model_size_mb=size_mb, label_names=valid.label_names) + complexity = len(spec.operators) + float(spec.params.get('n_kernels', 0)) / 256.0 + float(spec.params.get('n_shapelets', 0)) / 64.0 + metrics['score'] = score_from_metrics(metrics, cost_weight=cost_weight, complexity=complexity) + stages.append(StageResult('validation', True, metrics)) + stress_reports: dict[str, Any] = {} + stress_scores = [] + for i, (name, fn) in enumerate(STRESS_TRANSFORMS.items()): + if i >= max_stress_transforms: + break + Xs = fn(valid.X) + ps = model.predict(Xs, groups=valid.subject, time_index=valid.time_index) + mr = classification_report_dict(valid.y, ps, label_names=valid.label_names) + stress_reports[name] = {'macro_f1': mr['macro_f1'], 'worst_class_f1': mr['worst_class_f1'], 'balanced_accuracy': mr['balanced_accuracy']} + stress_scores.append(float(mr['macro_f1'])) + stress_macro = float(np.mean(stress_scores)) if stress_scores else float(metrics['macro_f1']) + stages.append(StageResult('stress', True, {'stress_macro_f1': stress_macro, 'stress_reports': stress_reports})) + pred_unique = int(len(np.unique(pred))) + no_collapse = pred_unique > 1 or int(train.n_classes) <= 1 + finite = bool(np.isfinite(metrics['macro_f1']) and np.isfinite(metrics['score'])) + anti = StageResult('anti_objective_hacking', bool(no_collapse and finite), {'n_unique_predictions': pred_unique, 'finite_metrics': finite, 'train_classes': int(train.n_classes)}, 'rejects collapsed or non-finite candidates') + stages.append(anti) + gap = float(metrics['macro_f1']) - stress_macro + cascade_score = float(metrics['score'] + robustness_weight * stress_macro - 0.05 * max(gap, 0.0)) + result = dict(metrics) + result.update({'candidate': spec.to_dict(), 'operator_certificate': TemporalProgram.from_candidate(spec).certificate(), 'stress_macro_f1': stress_macro, 'validation_to_stress_gap': gap, 'cascade_score': cascade_score}) + return CascadeResult(bool(anti.passed), cascade_score, stages, result) diff --git a/src/wisp/search/controller.py b/src/wisp/search/controller.py new file mode 100644 index 0000000000000000000000000000000000000000..3ad48540ed501cf571c83f83baa8e964726d2dd5 --- /dev/null +++ b/src/wisp/search/controller.py @@ -0,0 +1,277 @@ +# Paper-scoped implementation; see SOURCE_PROVENANCE.json. +from __future__ import annotations +import hashlib +import json +import os +import pickle +import time +from concurrent.futures import ThreadPoolExecutor +from dataclasses import dataclass +from pathlib import Path +from typing import Any +import numpy as np +from wisp.core.data import HARData, concatenate_har +from wisp.core.metrics import classification_report_dict +from wisp.cpu.algorithms import build_cpu_estimator, estimate_pickle_size_mb +from wisp.search.cascade import evaluate_candidate_cascade +from wisp.search.dataset_fingerprint import DatasetFingerprint, compute_dataset_fingerprint +from wisp.search.grammar import CandidateSpec, initial_candidates, mutate_candidate, normalize_spec +from wisp.search.operator_program import TemporalProgram +from wisp.search.posterior import MotifPosterior, island_key, sample_parent +from wisp.search.profiles import SearchProfile, get_profile +from wisp.utils.jsonl import append_jsonl, read_jsonl + +def _positive_int_env(name: str, default: int) -> int: + try: + return max(int(os.environ.get(name, default)), 1) + except (TypeError, ValueError): + return max(int(default), 1) + +def _stable_id(*, seed: int, generation: int, index: int, spec: CandidateSpec) -> str: + payload = json.dumps(spec.to_dict(), sort_keys=True, separators=(',', ':'), default=str) + digest = hashlib.sha1(f'{seed}:{generation}:{index}:{payload}'.encode()).hexdigest()[:12] + return f'g{generation:03d}c{index:04d}_{digest}' + +def _spec_key(spec: CandidateSpec) -> str: + return json.dumps(normalize_spec(spec).to_dict(), sort_keys=True, separators=(',', ':'), default=str) + +@dataclass +class WISPSearchController: + train: HARData + valid: HARData + output: str | Path + profile: str | SearchProfile = 'wisp_evolution' + test: HARData | None = None + population: int = 24 + generations: int = 20 + seed: int = 42 + cost_weight: float = 0.01 + robustness_weight: float = 0.1 + candidate_workers: int | None = None + n_jobs_per_candidate: int | None = None + + def __post_init__(self) -> None: + if isinstance(self.profile, str): + self.profile = get_profile(self.profile) + if self.train.n_classes != self.valid.n_classes: + raise ValueError('train and validation must share the same global label vocabulary') + if self.test is not None and self.test.n_classes != self.train.n_classes: + raise ValueError('test must share the same global label vocabulary') + + def _worker_count(self) -> int: + if self.candidate_workers is not None: + return max(int(self.candidate_workers), 1) + return _positive_int_env('WISP_CANDIDATE_WORKERS', 1) + + def _per_candidate_jobs(self) -> int: + if self.n_jobs_per_candidate is not None: + return max(int(self.n_jobs_per_candidate), 1) + explicit = os.environ.get('WISP_N_JOBS_PER_CANDIDATE') + if explicit is not None: + return _positive_int_env('WISP_N_JOBS_PER_CANDIDATE', 1) + total = _positive_int_env('WISP_N_JOBS', 1) + return max(total // self._worker_count(), 1) + + def _runtime_spec(self, spec: CandidateSpec) -> CandidateSpec: + spec = normalize_spec(spec) + if spec.route != 'cpu': + raise ValueError('WISPSearchController is CPU-only; GPU search is not released') + params = dict(spec.params) + params.setdefault('n_jobs', self._per_candidate_jobs()) + return CandidateSpec(name=spec.name, params=params, operators=list(spec.operators), route='cpu', parent_id=spec.parent_id, mutation=spec.mutation) + + def _constrain_spec(self, spec: CandidateSpec) -> CandidateSpec | None: + spec = self._runtime_spec(spec) + allowed = self.profile.allowed_cpu_families + if allowed is not None and spec.name not in set(allowed): + return None + if self.profile.force_no_hmm: + params = dict(spec.params) + params['use_hmm'] = False + operators = [op for op in spec.operators if op != 'hmm'] + if 'argmax' not in operators: + operators.append('argmax') + spec = CandidateSpec(name=spec.name, params=params, operators=operators, route='cpu', parent_id=spec.parent_id, mutation=spec.mutation) + if spec.mutation in set(self.profile.disabled_mutations): + return None + return spec + + def _evaluate_one(self, spec: CandidateSpec) -> tuple[str, dict[str, Any]]: + try: + cascade = evaluate_candidate_cascade(spec, self.train, self.valid, cost_weight=self.cost_weight, robustness_weight=self.robustness_weight if self.profile.use_stress else 0.0, max_stress_transforms=4 if self.profile.use_stress else 0) + result = cascade.to_dict() + predictive = float(result.get('cascade_score', result.get('score', -1000000000.0))) + result['predictive_utility'] = predictive + return ('ok' if cascade.accepted else 'rejected', result) + except Exception as exc: + return ('failed', {'predictive_utility': -1000000000.0, 'breeding_score': -1000000000.0, 'error': repr(exc), 'candidate': spec.to_dict()}) + + def _evaluate_many(self, specs: list[CandidateSpec]) -> list[tuple[str, dict[str, Any]]]: + if not specs: + return [] + workers = min(self._worker_count(), len(specs)) + if workers <= 1: + return [self._evaluate_one(spec) for spec in specs] + with ThreadPoolExecutor(max_workers=workers, thread_name_prefix='wisp') as pool: + return list(pool.map(self._evaluate_one, specs)) + + def _initial_specs(self, posterior: MotifPosterior, fingerprint: DatasetFingerprint | None, family_transfer_bias: dict[str, float], rng: np.random.Generator, count: int) -> list[CandidateSpec]: + specs = posterior.rank_initial_candidates(fingerprint=fingerprint, seed=self.seed, route='cpu', include_v2=self.profile.include_v2_families, motif_mode=self.profile.motif_mode, family_transfer_bias=family_transfer_bias) + specs = [constrained for spec in specs if (constrained := self._constrain_spec(spec)) is not None] + if not specs: + raise RuntimeError(f'Profile {self.profile.name} removed every initial CPU family') + base = list(specs) + i = 0 + while len(specs) < count: + parent = base[i % len(base)] + clone = CandidateSpec.from_dict(parent.to_dict()) + clone.params = dict(clone.params) + clone.params['seed'] = int(clone.params.get('seed', self.seed)) + 1009 * (i + 1) + clone.mutation = 'initial_seed_variant' + specs.append(clone) + i += 1 + return [spec for spec in specs[:count]] + + def _random_spec(self, rng: np.random.Generator, fingerprint: DatasetFingerprint | None) -> CandidateSpec: + bases = initial_candidates(seed=int(rng.integers(0, 2 ** 31 - 1)), include_v2=self.profile.include_v2_families, route='cpu') + spec = CandidateSpec.from_dict(bases[int(rng.integers(0, len(bases)))].to_dict()) + depth = int(rng.integers(1, 5)) + for _ in range(depth): + spec = mutate_candidate(spec, rng=rng, mutation_bias=None, motif_weights=None if fingerprint is None else fingerprint.motif_weights()) + spec.parent_id = None + spec.mutation = f'random_depth_{depth}' + constrained = self._constrain_spec(spec) + if constrained is None: + return self._random_spec(rng, fingerprint) + return constrained + + def _record(self, *, db_path: Path, candidate_id: str, generation: int, spec: CandidateSpec, status: str, result: dict[str, Any], fingerprint: DatasetFingerprint | None, parent_id: str | None) -> dict[str, Any]: + row = {'id': candidate_id, 'generation': int(generation), 'parent_id': parent_id, 'island': island_key(spec), 'status': status, 'profile': self.profile.to_dict(), 'dataset_fingerprint': None if fingerprint is None else fingerprint.to_dict(), 'motif_weights': None if fingerprint is None else fingerprint.motif_weights(), 'operator_certificate': TemporalProgram.from_candidate(spec).certificate(), 'result': result, 'spec': spec.to_dict()} + append_jsonl(db_path, row) + return row + + def _final_refit(self, best: dict[str, Any], out_dir: Path) -> dict[str, Any] | None: + if self.test is None: + return None + spec = CandidateSpec.from_dict(best['spec']) + model = build_cpu_estimator(spec.to_dict()) + refit = concatenate_har(self.train, self.valid, source='train+validation') + t0 = time.perf_counter() + model.fit(refit.X, refit.y, groups=refit.subject, time_index=refit.time_index, n_classes=refit.n_classes) + fit_s = time.perf_counter() - t0 + t1 = time.perf_counter() + pred = model.predict(self.test.X, groups=self.test.subject, time_index=self.test.time_index) + pred_s = time.perf_counter() - t1 + metrics = classification_report_dict(self.test.y, pred, fit_seconds=fit_s, predict_seconds=pred_s, model_size_mb=estimate_pickle_size_mb(model), label_names=self.test.label_names) + np.savez_compressed(out_dir / 'locked_test_predictions.npz', y_true=self.test.y, y_pred=pred, subject=self.test.subject, time_index=self.test.time_index) + with (out_dir / 'selected_model.pkl').open('wb') as f: + pickle.dump(model, f) + (out_dir / 'locked_test_metrics.json').write_text(json.dumps(metrics, indent=2, ensure_ascii=False, default=str), encoding='utf-8') + return metrics + + def run(self) -> dict[str, Any]: + out_dir = Path(self.output) + out_dir.mkdir(parents=True, exist_ok=True) + db_path = out_dir / 'program_database.jsonl' + summary_path = out_dir / 'summary.json' + config = {'profile': self.profile.to_dict(), 'population': int(self.population), 'generations': int(self.generations), 'seed': int(self.seed), 'cost_weight': float(self.cost_weight), 'robustness_weight': float(self.robustness_weight), 'candidate_workers': self._worker_count(), 'n_jobs_per_candidate': self._per_candidate_jobs()} + if summary_path.exists(): + old = json.loads(summary_path.read_text(encoding='utf-8')) + if old.get('status') == 'completed' and old.get('search_config') == config: + return old + if db_path.exists() and db_path.stat().st_size: + raise RuntimeError(f'Refusing to append to non-empty search database {db_path}') + rng = np.random.default_rng(self.seed) + fingerprint = compute_dataset_fingerprint(self.train, seed=self.seed) if self.profile.use_fingerprint else None + family_transfer, mutation_transfer = ({}, {}) + posterior = MotifPosterior() + archive: list[CandidateSpec] = [] + population: list[tuple[str, CandidateSpec, dict[str, Any]]] = [] + rows: list[dict[str, Any]] = [] + seen: set[str] = set() + budget = int(self.profile.max_evaluations) + initial_count = min(9, budget) + seeds = self._initial_specs(posterior, fingerprint, family_transfer, rng, initial_count) + seed_results = self._evaluate_many(seeds) + for i, (spec, (status, result)) in enumerate(zip(seeds, seed_results)): + novelty = 0.0 + result['novelty_bonus'] = novelty + result['breeding_score'] = float(result.get('predictive_utility', -1000000000.0)) + novelty + cid = _stable_id(seed=self.seed, generation=0, index=i, spec=spec) + row = self._record(db_path=db_path, candidate_id=cid, generation=0, spec=spec, status=status, result=result, fingerprint=fingerprint, parent_id=None) + rows.append(row) + seen.add(_spec_key(spec)) + archive.append(spec) + if status == 'ok': + population.append((cid, spec, result)) + if self.profile.use_posterior: + posterior.update(spec, result, score_key='predictive_utility') + if not population: + raise RuntimeError('No accepted initial candidate') + evaluated = len(seeds) + generation = 0 + while evaluated < budget and generation < int(self.generations): + generation += 1 + remaining = budget - evaluated + proposal_count = min(max(self.population - max(2, self.population // 3), 1), remaining) + proposals: list[tuple[str, str | None, CandidateSpec]] = [] + attempts = 0 + mutation_bias = posterior.mutation_bias(fingerprint, motif_mode=self.profile.motif_mode, transfer_bias=mutation_transfer) if self.profile.use_posterior else mutation_transfer if self.profile.transfer_prior else {} + for disabled in self.profile.disabled_mutations: + mutation_bias.pop(disabled, None) + while len(proposals) < proposal_count: + attempts += 1 + if attempts > proposal_count * 100: + raise RuntimeError('Unable to generate enough unique candidate specifications') + if self.profile.search_strategy == 'random': + parent_id = None + child = self._random_spec(rng, fingerprint) + else: + parent_id, parent, parent_result = sample_parent(population, rng, use_islands=self.profile.use_islands, score_key='breeding_score') + child = None + if child is None: + child = mutate_candidate(parent, rng=rng, parent_id=parent_id, mutation_bias=mutation_bias, motif_weights=None if fingerprint is None else fingerprint.motif_weights()) + child = self._constrain_spec(child) + if child is None: + continue + key = _spec_key(child) + if key in seen: + continue + seen.add(key) + index = evaluated + len(proposals) + proposals.append((_stable_id(seed=self.seed, generation=generation, index=index, spec=child), parent_id, child)) + evaluated_results = self._evaluate_many([spec for _, _, spec in proposals]) + new_items: list[tuple[str, CandidateSpec, dict[str, Any]]] = [] + for (cid, parent_id, spec), (status, result) in zip(proposals, evaluated_results): + novelty = posterior.novelty_bonus(spec, archive) if self.profile.use_novelty and status == 'ok' else 0.0 + result['novelty_bonus'] = float(novelty) + result['breeding_score'] = float(result.get('predictive_utility', -1000000000.0)) + float(novelty) + row = self._record(db_path=db_path, candidate_id=cid, generation=generation, spec=spec, status=status, result=result, fingerprint=fingerprint, parent_id=parent_id) + rows.append(row) + archive.append(spec) + if status == 'ok': + new_items.append((cid, spec, result)) + if self.profile.use_posterior: + posterior.update(spec, result, score_key='predictive_utility') + evaluated += len(proposals) + if self.profile.search_strategy == 'evolution': + combined = population + new_items + combined.sort(key=lambda item: float(item[2].get('breeding_score', -1000000000.0)), reverse=True) + population = combined[:int(self.population)] + else: + population = (population + new_items)[-int(self.population):] + if not population: + raise RuntimeError(f'No accepted candidate after generation {generation}') + ok_rows = [row for row in rows if row['status'] == 'ok'] + if not ok_rows: + raise RuntimeError('Search completed without an accepted candidate') + final_key = self.profile.final_selection + best = max(ok_rows, key=lambda row: float(row['result'].get(final_key, -1000000000.0))) + best_breeding = max(ok_rows, key=lambda row: float(row['result'].get('breeding_score', -1000000000.0))) + best_predictive = max(ok_rows, key=lambda row: float(row['result'].get('predictive_utility', -1000000000.0))) + (out_dir / 'selected_candidate.json').write_text(json.dumps(best, indent=2, ensure_ascii=False, default=str), encoding='utf-8') + test_metrics = self._final_refit(best, out_dir) + summary = {'status': 'completed', 'version': 'wisp_search_controller', 'profile': self.profile.name, 'n_rows': len(rows), 'n_ok': len(ok_rows), 'n_evaluated': evaluated, 'best': best, 'best_predictive': best_predictive, 'best_breeding': best_breeding, 'locked_test_metrics': test_metrics, 'search_config': config, 'dataset_fingerprint': None if fingerprint is None else {**fingerprint.to_dict(), 'motifs': fingerprint.motifs(), 'motif_weights': fingerprint.motif_weights()}, 'posterior_summary': posterior.summary(), 'cross_task_family_bias': family_transfer, 'cross_task_mutation_bias': mutation_transfer} + summary_path.write_text(json.dumps(summary, indent=2, ensure_ascii=False, default=str), encoding='utf-8') + return summary +__all__ = ['WISPSearchController'] diff --git a/src/wisp/search/dataset_fingerprint.py b/src/wisp/search/dataset_fingerprint.py new file mode 100644 index 0000000000000000000000000000000000000000..e3221358f752de280154868dc947a4660fae0e9a --- /dev/null +++ b/src/wisp/search/dataset_fingerprint.py @@ -0,0 +1,129 @@ +# Paper-scoped implementation; see SOURCE_PROVENANCE.json. +from __future__ import annotations +from dataclasses import asdict, dataclass +from typing import Any +import numpy as np +from wisp.core.data import HARData +from wisp.search.motifs import CANONICAL_MOTIFS + +@dataclass +class DatasetFingerprint: + n_windows: int + n_timestamps: int + n_channels: int + n_classes: int + n_subjects: int | None + n_devices: int | None + class_imbalance: float + spectral_concentration: float + burstiness: float + autocorr_lag1: float + channel_correlation: float + missingness_rate: float + sampling_rate_hz: float | None + study_setting: str + source: str = 'unknown' + + def to_dict(self) -> dict[str, Any]: + return asdict(self) + + def motif_weights(self) -> dict[str, float]: + n_subjects = 0 if self.n_subjects is None else int(self.n_subjects) + n_devices = 0 if self.n_devices is None else int(self.n_devices) + setting = str(self.study_setting).lower() + free_living_meta = any((token in setting for token in ('free', 'home', 'natural', 'wild'))) + tail = np.clip(np.log1p(max(self.class_imbalance - 1.0, 0.0)) / np.log(10.0), 0.0, 1.0) + periodic = np.clip(max(self.spectral_concentration / 0.65, abs(self.autocorr_lag1) / 0.6), 0.0, 1.0) + hand = np.clip((self.burstiness - 1.0) / 2.5, 0.0, 1.0) + device = 1.0 if n_devices > 1 else np.clip(self.channel_correlation * 0.35, 0.0, 0.35) + subject = np.clip(n_subjects / 50.0, 0.0, 1.0) if n_subjects else 0.0 + multi = np.clip((self.n_channels - 3) / 6.0, 0.0, 1.0) + duration_s = self.n_timestamps / self.sampling_rate_hz if self.sampling_rate_hz is not None and self.sampling_rate_hz > 0 else self.n_timestamps / 50.0 + long_state = np.clip(max(duration_s / 10.0, abs(self.autocorr_lag1) / 0.55), 0.0, 1.0) + free_living = np.clip(max(1.0 if free_living_meta else 0.0, 0.65 * tail + 0.35 * long_state, self.missingness_rate * 4.0), 0.0, 1.0) + small = np.clip((20.0 - n_subjects) / 18.0, 0.0, 1.0) if n_subjects else 0.5 + weights = {'tail_risk': float(tail), 'periodic_locomotion': float(periodic), 'hand_micro_pattern': float(hand), 'device_shift': float(device), 'subject_shift': float(subject), 'multisensor_fusion': float(multi), 'long_window_state': float(long_state), 'free_living_noise': float(free_living), 'small_sample_risk': float(small)} + if set(weights) != set(CANONICAL_MOTIFS): + raise RuntimeError('fingerprint motif vocabulary does not match the canonical registry') + return weights + + def motifs(self, threshold: float=0.35) -> list[str]: + return [motif for motif, weight in self.motif_weights().items() if weight >= threshold] + + def legacy_motifs(self) -> list[str]: + motifs: list[str] = [] + if self.class_imbalance >= 3.0: + motifs.append('tail_risk') + if self.spectral_concentration >= 0.45 or self.autocorr_lag1 >= 0.35: + motifs.append('periodic_locomotion') + if self.burstiness >= 1.5: + motifs.append('hand_micro_pattern') + if self.n_devices is not None and self.n_devices > 1: + motifs.append('device_shift') + if self.n_subjects is not None and self.n_subjects >= 8: + motifs.append('subject_shift') + if self.n_channels >= 6: + motifs.append('multisensor_fusion') + if self.n_timestamps >= 250: + motifs.append('long_window_state') + return motifs + + def vector(self) -> np.ndarray: + weights = self.motif_weights() + return np.asarray([weights[m] for m in CANONICAL_MOTIFS], dtype=np.float64) + +def _spectral_concentration(X: np.ndarray) -> float: + x = X - np.nanmean(X, axis=1, keepdims=True) + x = np.nan_to_num(x, nan=0.0, posinf=0.0, neginf=0.0) + p = np.abs(np.fft.rfft(x, axis=1)) ** 2 + if p.shape[1] <= 2: + return 0.0 + p = p[:, 1:, :] + total = p.sum(axis=1) + 1e-12 + top = np.sort(p, axis=1)[:, -min(3, p.shape[1]):, :].sum(axis=1) + return float(np.nanmean(top / total)) + +def _burstiness(X: np.ndarray) -> float: + x = np.nan_to_num(X, nan=0.0, posinf=0.0, neginf=0.0) + d = np.diff(x, axis=1, prepend=x[:, :1, :]) + mag = np.linalg.norm(d[:, :, :min(3, X.shape[2])], axis=2) + return float(np.nanmean(np.quantile(mag, 0.95, axis=1) / (np.median(mag, axis=1) + 1e-06))) + +def _lag1(X: np.ndarray) -> float: + x = np.nan_to_num(X, nan=0.0, posinf=0.0, neginf=0.0) + x = x - x.mean(axis=1, keepdims=True) + num = np.sum(x[:, :-1, :] * x[:, 1:, :], axis=1) + den = np.sum(x * x, axis=1) + 1e-12 + return float(np.nanmean(num / den)) + +def _channel_corr(X: np.ndarray) -> float: + if X.shape[2] < 2: + return 0.0 + x = np.nan_to_num(X, nan=0.0, posinf=0.0, neginf=0.0) + vals = [] + for i in range(x.shape[2]): + for j in range(i + 1, x.shape[2]): + xi = x[:, :, i] - x[:, :, i].mean(axis=1, keepdims=True) + xj = x[:, :, j] - x[:, :, j].mean(axis=1, keepdims=True) + corr = np.sum(xi * xj, axis=1) / (np.sqrt(np.sum(xi * xi, axis=1) * np.sum(xj * xj, axis=1)) + 1e-12) + vals.append(np.abs(corr)) + return float(np.nanmean(np.concatenate(vals))) if vals else 0.0 + +def compute_dataset_fingerprint(data: HARData, *, max_windows: int=4096, seed: int=42) -> DatasetFingerprint: + rng = np.random.default_rng(seed) + X = np.asarray(data.X, dtype=np.float64) + missingness = float(np.mean(~np.isfinite(X))) if X.size else 0.0 + if X.shape[0] > max_windows: + idx = rng.choice(X.shape[0], size=max_windows, replace=False) + Xs = X[idx] + y = data.y[idx] + else: + Xs = X + y = data.y + counts = np.bincount(np.asarray(y, dtype=np.int64), minlength=max(int(data.n_classes), 1)) + positive = counts[counts > 0] + imbalance = float(positive.max() / max(positive.min(), 1)) if positive.size else 1.0 + n_subjects = int(len(np.unique(data.subject))) if data.subject is not None else None + n_devices = int(len(np.unique(data.device))) if data.device is not None else None + metadata = data.metadata or {} + return DatasetFingerprint(n_windows=int(data.X.shape[0]), n_timestamps=int(data.X.shape[1]), n_channels=int(data.X.shape[2]), n_classes=int(data.n_classes), n_subjects=n_subjects, n_devices=n_devices, class_imbalance=imbalance, spectral_concentration=_spectral_concentration(Xs), burstiness=_burstiness(Xs), autocorr_lag1=_lag1(Xs), channel_correlation=_channel_corr(Xs), missingness_rate=missingness, sampling_rate_hz=data.sampling_rate_hz, study_setting=str(metadata.get('study_setting', 'unknown')), source=data.source) diff --git a/src/wisp/search/grammar.py b/src/wisp/search/grammar.py new file mode 100644 index 0000000000000000000000000000000000000000..70d0525146bef56c5b20f4253ad40cf6d38e5ce4 --- /dev/null +++ b/src/wisp/search/grammar.py @@ -0,0 +1,145 @@ +# Paper-scoped implementation; see SOURCE_PROVENANCE.json. +from __future__ import annotations +from dataclasses import asdict, dataclass, field +from typing import Any, Literal +import numpy as np +from wisp.search.motifs import FAMILY_MOTIF_WEIGHTS, MOTIF_TO_MUTATION_PRIOR, family_motif_match +Route = Literal['cpu', 'gpu'] + +@dataclass +class CandidateSpec: + name: str + params: dict[str, Any] = field(default_factory=dict) + operators: list[str] = field(default_factory=list) + route: Route = 'cpu' + parent_id: str | None = None + mutation: str | None = None + + def to_dict(self) -> dict[str, Any]: + return asdict(self) + + @staticmethod + def from_dict(d: dict[str, Any]) -> 'CandidateSpec': + route = str(d.get('route', 'cpu')) + if route not in {'cpu', 'gpu'}: + raise ValueError(f'unknown route: {route}') + return CandidateSpec(name=str(d['name']), params=dict(d.get('params', {})), operators=list(d.get('operators', [])), route=route, parent_id=d.get('parent_id'), mutation=d.get('mutation')) +CPU_FAMILIES = ('har_sculpt_forest_hmm', 'rocket_sketch_ridge_hmm', 'symbolic_interval_forest', 'hybrid_cpu_ensemble', 'invariant_interval_shape_forest', 'state_rocket_interval_hmm', 'posterior_cpu_ensemble') +CPU_MUTATIONS = ('toggle_hmm', 'change_classifier', 'change_segments', 'change_symbolic_bins', 'switch_family', 'change_rocket_kernels', 'change_intervals', 'change_shapelets', 'reweight_ensemble', 'insert_invariance_motif', 'insert_state_motif') + +def initial_cpu_candidates(seed: int=42, *, include_v2: bool=True) -> list[CandidateSpec]: + base = [CandidateSpec(name='har_sculpt_forest_hmm', params={'classifier': 'extratrees', 'use_hmm': True, 'segment_sizes': (4, 8, 16), 'symbolic_bins': 6, 'seed': seed}, operators=['zscore', 'magnitude', 'jerk', 'multiscale_stats', 'fft_bands', 'autocorr', 'symbolic_transition', 'extratrees', 'hmm']), CandidateSpec(name='har_sculpt_forest_hmm', params={'classifier': 'rf', 'use_hmm': True, 'segment_sizes': (5, 10, 20), 'symbolic_bins': 8, 'seed': seed + 1}, operators=['zscore', 'magnitude', 'multiscale_stats', 'autocorr', 'symbolic_transition', 'rf', 'hmm']), CandidateSpec(name='rocket_sketch_ridge_hmm', params={'n_kernels': 256, 'classifier': 'ridge', 'use_hmm': True, 'seed': seed + 2}, operators=['zscore', 'random_conv', 'ppv_max_mean_std', 'ridge', 'hmm']), CandidateSpec(name='rocket_sketch_ridge_hmm', params={'n_kernels': 512, 'classifier': 'logreg', 'use_hmm': False, 'seed': seed + 3}, operators=['zscore', 'random_conv', 'ppv_max_mean_std', 'logreg', 'argmax']), CandidateSpec(name='symbolic_interval_forest', params={'use_hmm': True, 'seed': seed + 4}, operators=['segment', 'aggregate_stats', 'quantize', 'transition_histogram', 'extratrees', 'hmm']), CandidateSpec(name='hybrid_cpu_ensemble', params={'use_hmm': True, 'seed': seed + 5}, operators=['feature_union', 'random_conv', 'symbolic', 'probability_ensemble', 'hmm'])] + if not include_v2: + return base + base.extend([CandidateSpec(name='invariant_interval_shape_forest', params={'classifier': 'extratrees', 'use_hmm': True, 'segment_sizes': (4, 8, 16), 'symbolic_bins': 6, 'n_shapelets': 32, 'seed': seed + 6}, operators=['zscore', 'magnitude', 'jerk', 'gram_eig', 'dyadic_intervals', 'quantile_distribution', 'random_shapelet', 'extratrees', 'hmm']), CandidateSpec(name='state_rocket_interval_hmm', params={'n_kernels': 384, 'n_intervals': 24, 'classifier': 'ridge', 'use_hmm': True, 'seed': seed + 7}, operators=['zscore', 'random_conv', 'ppv_pool', 'dyadic_intervals', 'quantile_distribution', 'symbolic_transition', 'ridge', 'hmm']), CandidateSpec(name='posterior_cpu_ensemble', params={'use_hmm': True, 'seed': seed + 8, 'weights': (0.4, 0.35, 0.25)}, operators=['posterior_weighting', 'random_conv', 'invariant_physics', 'symbolic_transition', 'probability_ensemble', 'hmm'])]) + return base + +def initial_candidates(seed: int=42, *, include_v2: bool=True, route: Route='cpu', population: int | None=None) -> list[CandidateSpec]: + if route != 'cpu': + raise ValueError('Only CPU search is released') + candidates = initial_cpu_candidates(seed=seed, include_v2=include_v2) + return candidates if population is None else candidates[:int(population)] + +def _with_tuple(v: Any) -> Any: + if isinstance(v, list): + return tuple(v) + return v + +def normalize_spec(spec: CandidateSpec) -> CandidateSpec: + params = {k: _with_tuple(v) for k, v in spec.params.items()} + if 'segment_sizes' in params: + params['segment_sizes'] = tuple((int(x) for x in params['segment_sizes'])) + if 'weights' in params: + vals = np.asarray(params['weights'], dtype=np.float64) + if vals.size: + vals = vals / (float(vals.sum()) + 1e-12) + params['weights'] = tuple((float(x) for x in vals.tolist())) + return CandidateSpec(spec.name, params=params, operators=list(spec.operators), route=spec.route, parent_id=spec.parent_id, mutation=spec.mutation) + +def _replace_classifier_ops(ops: list[str], classifier: str) -> list[str]: + return [o for o in ops if o not in {'extratrees', 'rf', 'logreg', 'ridge'}] + [classifier] + +def _weighted_choice(items: list[str], bias: dict[str, float] | None, rng: np.random.Generator) -> str: + if not bias: + return str(rng.choice(items)) + weights = np.asarray([max(float(bias.get(item, 0.0)), 0.0) + 1e-06 for item in items], dtype=np.float64) + weights /= weights.sum() + return str(rng.choice(items, p=weights)) + +def _family_choice(route: Route, motif_weights: dict[str, float] | None, rng: np.random.Generator) -> str: + families = CPU_FAMILIES if route == 'cpu' else GPU_FAMILIES + if not motif_weights: + return str(rng.choice(families)) + scores = np.asarray([max(family_motif_match(family, motif_weights).score, 0.0) + 0.1 for family in families], dtype=np.float64) + scores /= scores.sum() + return str(rng.choice(families, p=scores)) + +def mutate_cpu_candidate(parent: CandidateSpec, *, rng: np.random.Generator, parent_id: str | None=None, mutation_bias: dict[str, float] | None=None, motif_weights: dict[str, float] | None=None) -> CandidateSpec: + child = normalize_spec(CandidateSpec.from_dict(parent.to_dict())) + ops = list(child.operators) + params = dict(child.params) + mutation = _weighted_choice(list(CPU_MUTATIONS), mutation_bias, rng) + if mutation == 'toggle_hmm': + params['use_hmm'] = not bool(params.get('use_hmm', True)) + ops = [o for o in ops if o not in {'hmm', 'argmax'}] + (['hmm'] if params['use_hmm'] else ['argmax']) + elif mutation == 'change_classifier': + if child.name in {'har_sculpt_forest_hmm', 'invariant_interval_shape_forest'}: + params['classifier'] = str(rng.choice(['extratrees', 'rf', 'logreg'])) + ops = _replace_classifier_ops(ops, params['classifier']) + elif child.name in {'rocket_sketch_ridge_hmm', 'state_rocket_interval_hmm'}: + params['classifier'] = str(rng.choice(['ridge', 'logreg'])) + ops = _replace_classifier_ops(ops, params['classifier']) + elif mutation == 'change_segments': + if child.name in {'har_sculpt_forest_hmm', 'invariant_interval_shape_forest'}: + pool = [3, 4, 5, 8, 10, 12, 16, 20, 25] + params['segment_sizes'] = tuple(sorted((int(x) for x in rng.choice(pool, size=3, replace=False)))) + if 'multiscale_stats' not in ops: + ops.append('multiscale_stats') + elif mutation == 'change_symbolic_bins': + if child.name in {'har_sculpt_forest_hmm', 'invariant_interval_shape_forest'}: + params['symbolic_bins'] = int(rng.choice([4, 5, 6, 8, 10])) + if 'symbolic_transition' not in ops: + ops.append('symbolic_transition') + elif mutation == 'change_rocket_kernels': + if child.name in {'rocket_sketch_ridge_hmm', 'state_rocket_interval_hmm'}: + values = [128, 256, 384, 512, 768] + if motif_weights and motif_weights.get('small_sample_risk', 0.0) >= 0.6: + values = [128, 256, 384] + params['n_kernels'] = int(rng.choice(values)) + elif mutation == 'change_intervals': + if child.name == 'state_rocket_interval_hmm': + params['n_intervals'] = int(rng.choice([8, 16, 24, 32, 48])) + else: + child = CandidateSpec.from_dict(initial_cpu_candidates(seed=int(rng.integers(0, 10000)))[7].to_dict()) + params, ops = (dict(child.params), list(child.operators)) + elif mutation == 'change_shapelets': + if child.name == 'invariant_interval_shape_forest': + values = [16, 24, 32, 48, 64] + if motif_weights and motif_weights.get('small_sample_risk', 0.0) >= 0.6: + values = [8, 16, 24] + params['n_shapelets'] = int(rng.choice(values)) + else: + child = CandidateSpec.from_dict(initial_cpu_candidates(seed=int(rng.integers(0, 10000)))[6].to_dict()) + params, ops = (dict(child.params), list(child.operators)) + elif mutation == 'reweight_ensemble': + if child.name != 'posterior_cpu_ensemble': + child = CandidateSpec.from_dict(initial_cpu_candidates(seed=int(rng.integers(0, 10000)))[8].to_dict()) + params, ops = (dict(child.params), list(child.operators)) + params['weights'] = tuple((float(x) for x in rng.dirichlet(np.ones(3)).tolist())) + elif mutation == 'insert_invariance_motif': + child = CandidateSpec.from_dict(initial_cpu_candidates(seed=int(rng.integers(0, 10000)))[6].to_dict()) + params, ops = (dict(child.params), list(child.operators)) + elif mutation == 'insert_state_motif': + child = CandidateSpec.from_dict(initial_cpu_candidates(seed=int(rng.integers(0, 10000)))[7].to_dict()) + params, ops = (dict(child.params), list(child.operators)) + elif mutation == 'switch_family': + family = _family_choice('cpu', motif_weights, rng) + templates = [s for s in initial_cpu_candidates(seed=int(rng.integers(0, 10000))) if s.name == family] + child = CandidateSpec.from_dict((templates[0] if templates else initial_cpu_candidates(seed=int(rng.integers(0, 10000)))[0]).to_dict()) + params, ops = (dict(child.params), list(child.operators)) + params['seed'] = int(params.get('seed', 42)) + int(rng.integers(1, 100000)) + return CandidateSpec(child.name, params=params, operators=ops, route='cpu', parent_id=parent_id, mutation=mutation) + +def mutate_candidate(parent: CandidateSpec, *, rng: np.random.Generator, parent_id: str | None=None, mutation_bias: dict[str, float] | None=None, motif_weights: dict[str, float] | None=None) -> CandidateSpec: + return mutate_cpu_candidate(parent, rng=rng, parent_id=parent_id, mutation_bias=mutation_bias, motif_weights=motif_weights) +OPERATOR_GRAMMAR: dict[str, Any] = {'representations': ['statistical_spectral', 'random_convolution', 'state_order', 'geometry_interval_shape', 'convolution_interval_state'], 'classifier': ['extratrees', 'rf', 'ridge', 'logreg'], 'decoding': ['argmax', 'hmm']} diff --git a/src/wisp/search/motifs.py b/src/wisp/search/motifs.py new file mode 100644 index 0000000000000000000000000000000000000000..5197daf42899afa196843f1463cac3cf0710b68d --- /dev/null +++ b/src/wisp/search/motifs.py @@ -0,0 +1,50 @@ +# Paper-scoped implementation; see SOURCE_PROVENANCE.json. +from __future__ import annotations +'Canonical task-motif ontology for TS-Evolve v3.\n\nv2 produced one vocabulary from the dataset fingerprint and another vocabulary\ninside operator certificates. Only exact string matches affected initial\ncandidate ranking, and several fingerprint motifs had no mutation prior. This\nmodule makes the mapping explicit and testable.\n\nThe values below are *search priors*, not physical constants and not formal\nmeasures of information preservation. They encode the intended relation\nbetween an observed task property and a candidate family/mutation.\n' +from collections.abc import Iterable, Mapping +from dataclasses import dataclass +from typing import Final +CANONICAL_MOTIFS: Final[tuple[str, ...]] = ('tail_risk', 'periodic_locomotion', 'hand_micro_pattern', 'device_shift', 'subject_shift', 'multisensor_fusion', 'long_window_state', 'free_living_noise', 'small_sample_risk') +TAG_TO_MOTIFS: Final[dict[str, tuple[str, ...]]] = {'tail_class_bias': ('tail_risk',), 'periodic_locomotion': ('periodic_locomotion',), 'local_periodicity': ('periodic_locomotion',), 'phase_tolerant_local_shape': ('periodic_locomotion', 'hand_micro_pattern'), 'micro_burst': ('hand_micro_pattern',), 'micro_pattern': ('hand_micro_pattern',), 'local_shape': ('hand_micro_pattern',), 'device_shift': ('device_shift',), 'device_shift_robustness': ('device_shift',), 'orientation_invariance': ('device_shift',), 'shift_scale_invariant': ('device_shift',), 'state_persistence': ('long_window_state',), 'state_dynamics': ('long_window_state',), 'transition_smoothing': ('long_window_state', 'free_living_noise'), 'free_living_noise': ('free_living_noise',), 'multi_view_cpu': ('multisensor_fusion',), 'posterior_over_motifs': ('multisensor_fusion',), 'robustness_by_diversity': ('subject_shift', 'device_shift'), 'fast_cpu': ('small_sample_risk',), 'nonlinear_cpu': ('tail_risk',), 'calibrated_cpu': ('tail_risk',)} +LEGACY_MOTIF_TO_MUTATION_PRIOR: Final[dict[str, dict[str, float]]] = {'free_living_noise': {'insert_state_motif': 3.0, 'toggle_hmm': 2.0, 'change_intervals': 1.5}, 'hand_micro_pattern': {'change_shapelets': 3.0, 'change_symbolic_bins': 2.0, 'change_segments': 1.5}, 'device_shift': {'insert_invariance_motif': 3.0, 'change_segments': 1.2}, 'periodic_locomotion': {'change_rocket_kernels': 2.0, 'insert_state_motif': 1.4}, 'small_scripted_overfit': {'reweight_ensemble': 2.0, 'switch_family': 1.4}} +MOTIF_TO_MUTATION_PRIOR: Final[dict[str, dict[str, float]]] = {'tail_risk': {'change_classifier': 2.5, 'reweight_ensemble': 1.5, 'insert_state_motif': 0.5}, 'periodic_locomotion': {'change_rocket_kernels': 2.5, 'insert_state_motif': 1.8, 'change_intervals': 1.0}, 'hand_micro_pattern': {'change_shapelets': 2.4, 'change_symbolic_bins': 1.8, 'change_segments': 1.5, 'insert_invariance_motif': 0.5}, 'device_shift': {'insert_invariance_motif': 3.0, 'reweight_ensemble': 1.2, 'switch_family': 0.8}, 'subject_shift': {'insert_invariance_motif': 1.8, 'reweight_ensemble': 1.5, 'switch_family': 1.0}, 'multisensor_fusion': {'reweight_ensemble': 2.6, 'change_intervals': 1.3, 'switch_family': 1.0}, 'long_window_state': {'insert_state_motif': 3.0, 'toggle_hmm': 2.0, 'change_intervals': 1.2}, 'free_living_noise': {'insert_state_motif': 2.8, 'toggle_hmm': 1.8, 'change_intervals': 1.5, 'reweight_ensemble': 0.8}, 'small_sample_risk': {'change_classifier': 2.0, 'switch_family': 1.2, 'change_rocket_kernels': 0.7, 'reweight_ensemble': 0.4}} +FAMILY_MOTIF_WEIGHTS: Final[dict[str, dict[str, float]]] = {'har_sculpt_forest_hmm': {'tail_risk': 1.5, 'periodic_locomotion': 1.3, 'long_window_state': 1.3, 'free_living_noise': 1.1, 'small_sample_risk': 1.0}, 'rocket_sketch_ridge_hmm': {'periodic_locomotion': 1.6, 'hand_micro_pattern': 1.4, 'subject_shift': 0.8, 'small_sample_risk': 1.2}, 'symbolic_interval_forest': {'hand_micro_pattern': 1.4, 'long_window_state': 1.2, 'tail_risk': 0.8, 'small_sample_risk': 0.9}, 'hybrid_cpu_ensemble': {'multisensor_fusion': 1.8, 'device_shift': 1.1, 'subject_shift': 1.2, 'tail_risk': 0.8}, 'invariant_interval_shape_forest': {'device_shift': 2.2, 'subject_shift': 1.2, 'hand_micro_pattern': 1.5, 'tail_risk': 0.7}, 'state_rocket_interval_hmm': {'periodic_locomotion': 1.8, 'long_window_state': 2.2, 'free_living_noise': 2.0, 'hand_micro_pattern': 0.7}, 'posterior_cpu_ensemble': {'multisensor_fusion': 2.0, 'device_shift': 1.2, 'subject_shift': 1.2, 'tail_risk': 1.0}, 'wrist_mamba_net': {'periodic_locomotion': 1.5, 'hand_micro_pattern': 1.3, 'subject_shift': 0.8}, 'neural_hmm_classifier': {'long_window_state': 2.0, 'free_living_noise': 1.8, 'tail_risk': 0.8}, 'mamba_neural_hmm': {'periodic_locomotion': 1.4, 'long_window_state': 2.1, 'free_living_noise': 1.8}, 'wrist_dg_state_mamba': {'device_shift': 2.2, 'subject_shift': 2.0, 'long_window_state': 1.1}, 'semi_markov_neural_hmm': {'long_window_state': 2.5, 'free_living_noise': 2.1, 'tail_risk': 0.7}} + +@dataclass(frozen=True) +class MotifMatch: + family: str + score: float + contributions: dict[str, float] + +def canonicalize_tags(tags: Iterable[str]) -> set[str]: + out: set[str] = set() + for raw in tags: + raw_s = str(raw) + if raw_s in CANONICAL_MOTIFS: + out.add(raw_s) + out.update(TAG_TO_MOTIFS.get(raw_s, ())) + return out + +def family_motif_match(family: str, motif_weights: Mapping[str, float]) -> MotifMatch: + priors = FAMILY_MOTIF_WEIGHTS.get(str(family), {}) + contributions = {motif: max(float(weight), 0.0) * max(float(priors.get(motif, 0.0)), 0.0) for motif, weight in motif_weights.items() if float(weight) > 0.0} + return MotifMatch(family=str(family), score=float(sum(contributions.values())), contributions=contributions) + +def mutation_prior_from_motifs(motif_weights: Mapping[str, float]) -> dict[str, float]: + out: dict[str, float] = {} + for motif, motif_strength in motif_weights.items(): + strength = max(float(motif_strength), 0.0) + for mutation, weight in MOTIF_TO_MUTATION_PRIOR.get(str(motif), {}).items(): + out[mutation] = out.get(mutation, 0.0) + strength * float(weight) + return out + +def validate_motif_registry() -> None: + missing_mutation = [m for m in CANONICAL_MOTIFS if not MOTIF_TO_MUTATION_PRIOR.get(m)] + if missing_mutation: + raise RuntimeError(f'canonical motifs without mutation prior: {missing_mutation}') + if not FAMILY_MOTIF_WEIGHTS: + raise RuntimeError('family motif registry is empty') + unknown = sorted({motif for profile in FAMILY_MOTIF_WEIGHTS.values() for motif in profile if motif not in CANONICAL_MOTIFS}) + if unknown: + raise RuntimeError(f'family profiles use unknown canonical motifs: {unknown}') +validate_motif_registry() diff --git a/src/wisp/search/operator_program.py b/src/wisp/search/operator_program.py new file mode 100644 index 0000000000000000000000000000000000000000..c8ff40d441f431346da09a66483d43786b69396a --- /dev/null +++ b/src/wisp/search/operator_program.py @@ -0,0 +1,96 @@ +# Paper-scoped implementation; see SOURCE_PROVENANCE.json. +from __future__ import annotations +from dataclasses import asdict, dataclass, field +from typing import Any +import numpy as np +from wisp.search.grammar import CandidateSpec +from wisp.search.motifs import canonicalize_tags, family_motif_match + +@dataclass(frozen=True) +class OperatorNode: + name: str + family: str + information: float = 0.0 + invariance: float = 0.0 + dynamics: float = 0.0 + reconstructability: float = 0.0 + cost: float = 1.0 + tags: tuple[str, ...] = () + + def to_dict(self) -> dict[str, Any]: + d = asdict(self) + d['tags'] = list(self.tags) + return d +OPERATOR_LIBRARY: dict[str, OperatorNode] = {'identity': OperatorNode('identity', 'preprocess', information=1.0, reconstructability=1.0, cost=0.1, tags=('lossless',)), 'zscore': OperatorNode('zscore', 'preprocess', information=0.5, invariance=0.8, reconstructability=0.0, cost=0.2, tags=('shift_scale_invariant',)), 'magnitude': OperatorNode('magnitude', 'derive', information=0.5, invariance=0.8, cost=0.3, tags=('orientation_invariance',)), 'jerk': OperatorNode('jerk', 'derive', information=0.6, dynamics=0.8, cost=0.3, tags=('micro_burst',)), 'gram_eig': OperatorNode('gram_eig', 'derive', information=0.45, invariance=0.8, cost=0.4, tags=('device_shift', 'orientation_invariance')), 'intrinsic_timescale': OperatorNode('intrinsic_timescale', 'derive', information=0.45, dynamics=0.7, cost=0.4, tags=('state_persistence',)), 'multiscale_stats': OperatorNode('multiscale_stats', 'aggregate', information=0.65, dynamics=0.55, cost=1.0, tags=('local_shape',)), 'multiscale_interval_stats': OperatorNode('multiscale_interval_stats', 'aggregate', information=0.65, dynamics=0.55, cost=1.0, tags=('local_shape',)), 'dyadic_intervals': OperatorNode('dyadic_intervals', 'segment', information=0.6, dynamics=0.5, cost=0.8, tags=('interval_distribution',)), 'quantile_distribution': OperatorNode('quantile_distribution', 'aggregate', information=0.55, invariance=0.3, dynamics=0.4, cost=0.8, tags=('distribution_shape',)), 'random_shapelet': OperatorNode('random_shapelet', 'aggregate', information=0.7, invariance=0.2, dynamics=0.75, cost=1.4, tags=('local_shape', 'micro_burst')), 'aggregate_stats': OperatorNode('aggregate_stats', 'aggregate', information=0.55, cost=0.7, tags=('summary',)), 'segment': OperatorNode('segment', 'segment', information=0.7, cost=0.4, tags=('localization',)), 'fft_bands': OperatorNode('fft_bands', 'spectral', information=0.55, invariance=0.35, dynamics=0.55, cost=0.5, tags=('periodic_locomotion',)), 'autocorr': OperatorNode('autocorr', 'spectral', information=0.55, invariance=0.35, dynamics=0.75, cost=0.5, tags=('periodic_locomotion', 'state_persistence')), 'random_conv': OperatorNode('random_conv', 'random_conv', information=0.7, dynamics=0.65, cost=1.3, tags=('phase_tolerant_local_shape',)), 'ppv_pool': OperatorNode('ppv_pool', 'random_conv', information=0.45, invariance=0.5, cost=0.3, tags=('phase_tolerant_local_shape',)), 'ppv_max_mean_std': OperatorNode('ppv_max_mean_std', 'random_conv', information=0.55, invariance=0.5, cost=0.4, tags=('phase_tolerant_local_shape',)), 'symbolic_transition': OperatorNode('symbolic_transition', 'symbolic', information=0.35, invariance=0.5, dynamics=0.85, cost=0.9, tags=('state_dynamics', 'micro_pattern')), 'transition_histogram': OperatorNode('transition_histogram', 'symbolic', information=0.35, invariance=0.5, dynamics=0.8, cost=0.8, tags=('state_dynamics',)), 'quantize': OperatorNode('quantize', 'symbolic', information=0.25, invariance=0.4, cost=0.3, tags=('symbolic',)), 'symbolic': OperatorNode('symbolic', 'symbolic', information=0.35, dynamics=0.7, cost=0.8, tags=('state_dynamics',)), 'extratrees': OperatorNode('extratrees', 'classifier_cpu', information=0.4, cost=1.1, tags=('nonlinear_cpu',)), 'rf': OperatorNode('rf', 'classifier_cpu', information=0.4, cost=1.1, tags=('nonlinear_cpu',)), 'ridge': OperatorNode('ridge', 'classifier_cpu', information=0.3, cost=0.4, tags=('fast_cpu',)), 'logreg': OperatorNode('logreg', 'classifier_cpu', information=0.3, cost=0.6, tags=('calibrated_cpu',)), 'probability_ensemble': OperatorNode('probability_ensemble', 'classifier_cpu', information=0.55, cost=1.3, tags=('multi_view_cpu',)), 'posterior_weighting': OperatorNode('posterior_weighting', 'posterior', information=0.45, cost=0.5, tags=('posterior_over_motifs',)), 'invariant_physics': OperatorNode('invariant_physics', 'derive', information=0.55, invariance=0.8, cost=1.0, tags=('device_shift',)), 'feature_union': OperatorNode('feature_union', 'fusion', information=0.65, cost=1.2, tags=('multi_view_cpu',)), 'hmm': OperatorNode('hmm', 'postprocess', information=0.25, dynamics=0.9, cost=0.4, tags=('transition_smoothing', 'free_living_noise')), 'argmax': OperatorNode('argmax', 'postprocess', information=0.1, cost=0.1, tags=('window_only',))} + +@dataclass +class TemporalProgram: + name: str + route: str + nodes: list[OperatorNode] + params: dict[str, Any] = field(default_factory=dict) + parent_id: str | None = None + mutation: str | None = None + + @classmethod + def from_candidate(cls, spec: CandidateSpec) -> 'TemporalProgram': + nodes = [OPERATOR_LIBRARY.get(op, OperatorNode(op, 'unknown', cost=1.0)) for op in spec.operators] + return cls(name=spec.name, route=spec.route, nodes=nodes, params=dict(spec.params), parent_id=spec.parent_id, mutation=spec.mutation) + + def to_candidate(self) -> CandidateSpec: + return CandidateSpec(name=self.name, route=self.route, params=dict(self.params), operators=[node.name for node in self.nodes], parent_id=self.parent_id, mutation=self.mutation) + + @property + def operators(self) -> list[str]: + return [node.name for node in self.nodes] + + @property + def families(self) -> list[str]: + return [node.family for node in self.nodes] + + def certificate(self) -> dict[str, Any]: + if not self.nodes: + return {} + arr = np.asarray([[n.information, n.invariance, n.dynamics, n.reconstructability, n.cost] for n in self.nodes], dtype=np.float64) + tags: set[str] = set() + for node in self.nodes: + tags.update(node.tags) + canonical = canonicalize_tags(tags) + return {'name': self.name, 'route': self.route, 'n_operators': len(self.nodes), 'operator_trace': self.operators, 'family_trace': self.families, 'mean_information': float(np.mean(arr[:, 0])), 'mean_invariance': float(np.mean(arr[:, 1])), 'mean_dynamics': float(np.mean(arr[:, 2])), 'mean_reconstructability': float(np.mean(arr[:, 3])), 'estimated_cost': float(np.sum(arr[:, 4])), 'tags': sorted(tags), 'canonical_motifs': sorted(canonical), 'task_representation_congruence': self.task_congruence()} + + def motif_match(self, motif_weights: dict[str, float]) -> dict[str, Any]: + match = family_motif_match(self.name, motif_weights) + return {'family': match.family, 'score': match.score, 'contributions': match.contributions} + + def task_congruence(self) -> dict[str, float]: + tags = set() + for node in self.nodes: + tags.update(node.tags) + score = {'Capture24_free_living': 0.0, 'WISDM_micro_actions': 0.0, 'HHAR_device_shift': 0.0, 'PAMAP2_multisensor': 0.0, 'MHEALTH_small_scripted': 0.0} + score['Capture24_free_living'] += 0.35 if 'free_living_noise' in tags else 0.0 + score['Capture24_free_living'] += 0.25 if 'transition_smoothing' in tags else 0.0 + score['Capture24_free_living'] += 0.2 if 'periodic_locomotion' in tags else 0.0 + score['Capture24_free_living'] += 0.2 if 'orientation_invariance' in tags else 0.0 + score['WISDM_micro_actions'] += 0.35 if 'micro_burst' in tags or 'micro_pattern' in tags else 0.0 + score['WISDM_micro_actions'] += 0.25 if 'local_shape' in tags else 0.0 + score['WISDM_micro_actions'] += 0.2 if 'state_dynamics' in tags else 0.0 + score['WISDM_micro_actions'] += 0.2 if 'phase_tolerant_local_shape' in tags else 0.0 + score['HHAR_device_shift'] += 0.45 if 'device_shift' in tags else 0.0 + score['HHAR_device_shift'] += 0.35 if 'orientation_invariance' in tags else 0.0 + score['HHAR_device_shift'] += 0.2 if 'fast_cpu' in tags or 'phase_tolerant_local_shape' in tags else 0.0 + score['PAMAP2_multisensor'] += 0.3 if 'multi_view_cpu' in tags else 0.0 + score['PAMAP2_multisensor'] += 0.25 if 'local_shape' in tags else 0.0 + score['PAMAP2_multisensor'] += 0.25 if 'periodic_locomotion' in tags else 0.0 + score['PAMAP2_multisensor'] += 0.2 if 'state_dynamics' in tags else 0.0 + score['MHEALTH_small_scripted'] += 0.35 if 'fast_cpu' in tags else 0.0 + score['MHEALTH_small_scripted'] += 0.25 if 'local_shape' in tags else 0.0 + score['MHEALTH_small_scripted'] += 0.2 if 'interval_distribution' in tags else 0.0 + score['MHEALTH_small_scripted'] += 0.2 if 'multi_view_cpu' in tags else 0.0 + return {k: float(min(v, 1.0)) for k, v in score.items()} + +def jaccard_novelty(a: CandidateSpec, b: CandidateSpec) -> float: + A = set(a.operators) + B = set(b.operators) + if not A and (not B): + return 0.0 + return 1.0 - len(A & B) / max(len(A | B), 1) diff --git a/src/wisp/search/posterior.py b/src/wisp/search/posterior.py new file mode 100644 index 0000000000000000000000000000000000000000..e7ac0a3ca8ebfbba40e9d30af0d4be469f833cf0 --- /dev/null +++ b/src/wisp/search/posterior.py @@ -0,0 +1,118 @@ +# Paper-scoped implementation; see SOURCE_PROVENANCE.json. +from __future__ import annotations +from collections import Counter, defaultdict +from dataclasses import dataclass, field +from pathlib import Path +from typing import Any +import numpy as np +from wisp.search.dataset_fingerprint import DatasetFingerprint +from wisp.search.grammar import CandidateSpec, initial_candidates +from wisp.search.motifs import family_motif_match, mutation_prior_from_motifs +from wisp.search.operator_program import TemporalProgram, jaccard_novelty +from wisp.utils.jsonl import read_jsonl + +@dataclass +class MotifPosterior: + family_scores: dict[str, list[float]] = field(default_factory=lambda: defaultdict(list)) + operator_scores: dict[str, list[float]] = field(default_factory=lambda: defaultdict(list)) + mutation_scores: dict[str, list[float]] = field(default_factory=lambda: defaultdict(list)) + motif_scores: dict[str, list[float]] = field(default_factory=lambda: defaultdict(list)) + n_records: int = 0 + + def update(self, spec: CandidateSpec, result: dict[str, Any], *, score_key: str='predictive_utility') -> None: + score = float(result.get(score_key, result.get('cascade_score', result.get('score', result.get('macro_f1', 0.0))))) + self.family_scores[spec.name].append(score) + for op in spec.operators: + self.operator_scores[op].append(score) + if spec.mutation: + self.mutation_scores[str(spec.mutation)].append(score) + cert = TemporalProgram.from_candidate(spec).certificate() + for motif in cert.get('canonical_motifs', []): + self.motif_scores[str(motif)].append(score) + self.n_records += 1 + + @classmethod + def from_database(cls, path: str | Path, *, score_key: str='predictive_utility') -> 'MotifPosterior': + post = cls() + p = Path(path) + if not p.exists(): + return post + for row in read_jsonl(p): + spec_d = row.get('spec') or row.get('result', {}).get('candidate') + result = row.get('result', {}) + if not spec_d or row.get('status') not in {None, 'ok'}: + continue + try: + post.update(CandidateSpec.from_dict(spec_d), result, score_key=score_key) + except Exception: + continue + return post + + @staticmethod + def _mean(values: list[float]) -> float: + return float(np.mean(values)) if values else 0.0 + + def summary(self) -> dict[str, Any]: + return {'n_records': self.n_records, 'family_mean_scores': {k: self._mean(v) for k, v in sorted(self.family_scores.items())}, 'operator_mean_scores': {k: self._mean(v) for k, v in sorted(self.operator_scores.items())}, 'mutation_mean_scores': {k: self._mean(v) for k, v in sorted(self.mutation_scores.items())}, 'motif_mean_scores': {k: self._mean(v) for k, v in sorted(self.motif_scores.items())}} + + def mutation_bias(self, fingerprint: DatasetFingerprint | None=None, *, motif_mode: str='canonical', transfer_bias: dict[str, float] | None=None) -> dict[str, float]: + bias: Counter[str] = Counter() + if self.mutation_scores: + means = {k: self._mean(v) for k, v in self.mutation_scores.items()} + median = float(np.median(list(means.values()))) + for mutation, value in means.items(): + bias[mutation] += max(0.0, value - median) * 10.0 + if fingerprint is not None: + if motif_mode == 'canonical': + bias.update(mutation_prior_from_motifs(fingerprint.motif_weights())) + if transfer_bias: + bias.update({k: float(v) for k, v in transfer_bias.items()}) + return dict(bias) + + def rank_initial_candidates(self, *, fingerprint: DatasetFingerprint | None=None, seed: int=42, route: str='cpu', population: int | None=None, include_v2: bool=True, motif_mode: str='canonical', family_transfer_bias: dict[str, float] | None=None) -> list[CandidateSpec]: + candidates = initial_candidates(seed=seed, include_v2=include_v2, route=route, population=population) + if fingerprint is None or motif_mode == 'none': + return candidates + motif_weights = fingerprint.motif_weights() + motifs = set(fingerprint.motifs()) + ranked: list[tuple[float, CandidateSpec]] = [] + for spec in candidates: + empirical = self._mean(self.family_scores.get(spec.name, [])) + transfer = float((family_transfer_bias or {}).get(spec.name, 0.0)) + congruence = family_motif_match(spec.name, motif_weights).score + ranked.append((congruence + empirical + transfer, spec)) + ranked.sort(key=lambda item: item[0], reverse=True) + return [spec for _, spec in ranked] + + @staticmethod + def novelty_bonus(spec: CandidateSpec, archive: list[CandidateSpec], *, weight: float=0.02) -> float: + if not archive or weight <= 0.0: + return 0.0 + return float(weight * np.mean([jaccard_novelty(spec, other) for other in archive[-50:]])) + +def island_key(spec: CandidateSpec) -> str: + cert = TemporalProgram.from_candidate(spec).certificate() + families = cert.get('family_trace', []) + counts = Counter(families) + top_family = counts.most_common(1)[0][0] if counts else spec.name + cost = float(cert.get('estimated_cost', 0.0)) + cost_bin = 'small' if cost < 5 else 'medium' if cost < 9 else 'large' + motifs = cert.get('canonical_motifs', []) + motif = motifs[0] if motifs else 'untagged' + return f'{spec.route}:{top_family}:{cost_bin}:{motif}' + +def sample_parent(population: list[tuple[str, CandidateSpec, dict[str, Any]]], rng: np.random.Generator, *, use_islands: bool=True, score_key: str='breeding_score') -> tuple[str, CandidateSpec, dict[str, Any]]: + if not population: + raise ValueError('population must be non-empty') + if not use_islands: + members = sorted(population, key=lambda x: float(x[2].get(score_key, -1000000000.0)), reverse=True) + rank = int(min(len(members) - 1, rng.geometric(0.55) - 1)) + return members[rank] + islands: dict[str, list[tuple[str, CandidateSpec, dict[str, Any]]]] = defaultdict(list) + for item in population: + islands[island_key(item[1])].append(item) + keys = list(islands) + key = min(keys, key=lambda k: len(islands[k])) if rng.random() < 0.25 else str(rng.choice(keys)) + members = sorted(islands[key], key=lambda x: float(x[2].get(score_key, -1000000000.0)), reverse=True) + rank = int(min(len(members) - 1, rng.geometric(0.55) - 1)) + return members[rank] diff --git a/src/wisp/search/profiles.py b/src/wisp/search/profiles.py new file mode 100644 index 0000000000000000000000000000000000000000..42677cbe4b6b4937a4c63e8dae9a270039da7812 --- /dev/null +++ b/src/wisp/search/profiles.py @@ -0,0 +1,37 @@ +from dataclasses import replace +from dataclasses import asdict, dataclass +from typing import Literal +SearchStrategy = Literal['evolution', 'random'] +MotifMode = Literal['none', 'legacy', 'canonical'] +FinalSelection = Literal['breeding_score', 'predictive_utility'] + +@dataclass(frozen=True) +class SearchProfile: + name: str + include_v2_families: bool + use_fingerprint: bool + motif_mode: MotifMode + use_posterior: bool + use_islands: bool + use_novelty: bool + use_stress: bool + use_llm: bool = False + llm_probability: float = 0.0 + search_strategy: SearchStrategy = 'evolution' + final_selection: FinalSelection = 'predictive_utility' + strict_class_alignment: bool = True + transfer_prior: bool = False + max_evaluations: int = 329 + allowed_cpu_families: tuple[str, ...] | None = None + disabled_mutations: tuple[str, ...] = () + force_no_hmm: bool = False + + def to_dict(self) -> dict[str, object]: + return asdict(self) + +_E = SearchProfile(name="wisp_evolution", include_v2_families=True, use_fingerprint=True, + motif_mode="canonical", use_posterior=True, use_islands=True, use_novelty=True, use_stress=True) +PROFILES = {"wisp_evolution": _E, "wisp_random": replace(_E, name="wisp_random", search_strategy="random", use_islands=False, use_posterior=False, use_novelty=False)} +def get_profile(name): + if name not in PROFILES: raise ValueError(f"Unknown search: {name}") + return PROFILES[name] diff --git a/src/wisp/utils/__init__.py b/src/wisp/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/src/wisp/utils/__init__.py @@ -0,0 +1 @@ + diff --git a/src/wisp/utils/jsonl.py b/src/wisp/utils/jsonl.py new file mode 100644 index 0000000000000000000000000000000000000000..caa1226d6ecea3cadea76ad6d20fd2b04fd73b62 --- /dev/null +++ b/src/wisp/utils/jsonl.py @@ -0,0 +1,23 @@ +# Paper-scoped implementation; see SOURCE_PROVENANCE.json. +from __future__ import annotations +import json +from pathlib import Path +from typing import Any, Iterable + +def append_jsonl(path: str | Path, row: dict[str, Any]) -> None: + p = Path(path) + p.parent.mkdir(parents=True, exist_ok=True) + with p.open('a', encoding='utf-8') as f: + f.write(json.dumps(row, ensure_ascii=False, sort_keys=True) + '\n') + +def read_jsonl(path: str | Path) -> list[dict[str, Any]]: + p = Path(path) + if not p.exists(): + return [] + rows: list[dict[str, Any]] = [] + with p.open('r', encoding='utf-8') as f: + for line in f: + line = line.strip() + if line: + rows.append(json.loads(line)) + return rows diff --git a/src/wisp_release/__init__.py b/src/wisp_release/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4c3f382d8345ce6b99b6f1fecbc57a28250f1a0a --- /dev/null +++ b/src/wisp_release/__init__.py @@ -0,0 +1,8 @@ +"""Small release interfaces for WISP; importing this package performs no work.""" + +from .checkpoints import load_checkpoint, predict_checkpoint +from .methods import list_methods +from .selection import fit_selector + +__all__ = ["load_checkpoint", "predict_checkpoint", "list_methods", "fit_selector"] +__version__ = "0.1.0" diff --git a/src/wisp_release/checkpoints.py b/src/wisp_release/checkpoints.py new file mode 100644 index 0000000000000000000000000000000000000000..e2b57e60c239e1bbd5dee4891c86f6fb26278442 --- /dev/null +++ b/src/wisp_release/checkpoints.py @@ -0,0 +1,171 @@ +"""Explicitly trusted legacy checkpoint loading and guarded inference. + +Pickle executes code. Namespace compatibility and SHA256 comparison do not make +an untrusted pickle safe; users must opt in before any unpickling takes place. +""" + +from __future__ import annotations + +import hashlib +import hmac +import pickle +import re +from pathlib import Path +from typing import Any, Mapping + + +class WISPUnpickler(pickle.Unpickler): + """Map historical method modules, without installing process-wide aliases. + + This is a compatibility loader, NOT a restricted or sandboxed unpickler. + """ + + def find_class(self, module: str, name: str) -> Any: + if module == "tsevolve.search.ts_evolve_v3": + module = "wisp.search.controller" + elif module == "tsevolve" or module.startswith("tsevolve."): + module = "wisp" + module[len("tsevolve"):] + return super().find_class(module, name) + + +def sha256_file(path: str | Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(1024 * 1024), b""): + digest.update(block) + return digest.hexdigest() + + +def load_checkpoint(path: str | Path, *, trust_pickle: bool = False, + expected_sha256: str | None = None) -> Any: + """Load a trusted fitted WISP estimator, optionally checking its SHA256. + + Supply ``expected_sha256`` from an independently trusted source. A digest + supplied alongside a checkpoint proves integrity, not publisher identity. + Historical checkpoint files are left unchanged on disk. + """ + if not trust_pickle: + raise ValueError("Pickle can execute arbitrary code. Load only trusted WISP " + "checkpoints and explicitly set trust_pickle=True.") + path = Path(path) + if expected_sha256 is not None: + if not re.fullmatch(r"[0-9a-fA-F]{64}", expected_sha256): + raise ValueError("expected_sha256 must be a 64-character hexadecimal digest") + if not hmac.compare_digest(sha256_file(path), expected_sha256.lower()): + raise ValueError(f"SHA256 mismatch for {path.name}; refusing to unpickle") + with path.open("rb") as stream: + model = WISPUnpickler(stream).load() + if not callable(getattr(model, "predict", None)): + raise TypeError("Checkpoint does not contain a fitted estimator with predict()") + return model + + +def _array_vector(value: Any, *, name: str, n: int) -> Any: + import numpy as np + + array = np.asarray(value) + if array.ndim != 1 or len(array) != n: + raise ValueError(f"{name} must be a one-dimensional vector with {n} entries") + return array + + +def _check_X(X: Any, metadata: Mapping[str, Any] | None = None) -> Any: + import numpy as np + + array = np.asarray(X, dtype=np.float64) + if array.ndim != 3 or not all(array.shape): + raise ValueError("X must have nonempty shape (n_windows, n_timepoints, n_channels)") + if not np.isfinite(array).all(): + raise ValueError("X contains NaN or infinite values; apply the dataset preprocessing first") + if metadata and metadata.get("input_shape") is not None: + expected = tuple(int(v) for v in metadata["input_shape"]) + # A complete source array shape may include a variable number of windows. + if len(expected) == 3: + expected = expected[1:] + if len(expected) != 2 or array.shape[1:] != expected: + raise ValueError(f"Checkpoint expects time/channel shape {expected}; got {array.shape[1:]}") + return array + + +def _validate_class_axis(model: Any, metadata: Mapping[str, Any] | None) -> None: + """Never redefine a fitted global class axis using a shorter input vocabulary.""" + import numpy as np + + classes = getattr(model, "classes_", None) + if classes is not None: + classes = np.asarray(classes) + if (classes.ndim != 1 or not len(classes) + or not np.issubdtype(classes.dtype, np.integer) + or not np.array_equal(classes, np.arange(len(classes)))): + raise ValueError("Checkpoint classes_ must be the contiguous encoded global " + "axis 0..K-1; refusing to silently remap a nonstandard class axis") + names = None if metadata is None else metadata.get("label_names") + if names is not None: + if isinstance(names, (str, bytes)) or np.asarray(names).ndim != 1: + raise ValueError("label_names must be a one-dimensional global class vocabulary") + if classes is not None and len(names) != len(classes): + raise ValueError(f"label_names has {len(names)} entries but checkpoint global " + f"classes_ has {len(classes)}; preserve the complete fitted vocabulary") + + +def require_sequence_metadata(model: Any, subject: Any, time_index: Any, *, n: int) -> tuple[Any, Any]: + """Do not silently bypass the sequence decoder stored in a checkpoint.""" + needs_sequence = getattr(model, "smoother_", None) is not None + if needs_sequence and (subject is None or time_index is None): + raise ValueError("This checkpoint uses the sequence decoder: both subject " + "(sequence/session IDs) and time_index are required. " + "Do not merge unrelated recording sessions into one sequence.") + if subject is not None: + subject = _array_vector(subject, name="subject", n=n) + if time_index is not None: + time_index = _array_vector(time_index, name="time_index", n=n) + return subject, time_index + + +def set_inference_jobs(model: Any, n_jobs: int) -> None: + """Limit the known fitted estimator/ensemble members without refitting.""" + if n_jobs < 1: + raise ValueError("n_jobs must be positive") + seen: set[int] = set() + + def visit(estimator: Any) -> None: + if estimator is None or id(estimator) in seen: + return + seen.add(id(estimator)) + if hasattr(estimator, "n_jobs"): + estimator.n_jobs = n_jobs + for attr in ("model_", "members_", "estimators_", "steps"): + child = getattr(estimator, attr, None) + if isinstance(child, (tuple, list)): + for item in child: + visit(item[-1] if isinstance(item, tuple) else item) + elif child is not None: + visit(child) + + visit(model) + + +def predict_checkpoint(model: Any, X: Any, *, subject: Any = None, + time_index: Any = None, metadata: Mapping[str, Any] | None = None, + n_jobs: int = 1) -> Any: + """Predict encoded class IDs using the fitted checkpoint's actual decoder. + + ``metadata`` may contain ``input_shape=[T,C]`` and ``label_names``; it never + authorizes pickle loading, downloads data, or silently changes a decoder. + """ + import numpy as np + + _validate_class_axis(model, metadata) + X = _check_X(X, metadata) + subject, time_index = require_sequence_metadata(model, subject, time_index, n=len(X)) + set_inference_jobs(model, n_jobs) + prediction = np.asarray(model.predict(X, groups=subject, time_index=time_index)) + if prediction.ndim != 1 or len(prediction) != len(X): + raise ValueError("Model returned an invalid prediction shape") + if not np.issubdtype(prediction.dtype, np.integer): + raise ValueError("WISP checkpoints must return encoded integer class IDs") + prediction = prediction.astype(np.int64, copy=False) + names = None if metadata is None else metadata.get("label_names") + if names is not None and len(prediction) and (prediction.min() < 0 or prediction.max() >= len(names)): + raise ValueError("Predictions are incompatible with the supplied label_names") + return prediction diff --git a/src/wisp_release/cli.py b/src/wisp_release/cli.py new file mode 100644 index 0000000000000000000000000000000000000000..7084d3fec98e662a3f496b7c2b7f2dc6dc2b4547 --- /dev/null +++ b/src/wisp_release/cli.py @@ -0,0 +1,307 @@ +"""Command-line release entry points. No network calls or baseline imports.""" + +from __future__ import annotations + +import argparse +import csv +import json +import pickle +from collections import Counter +from dataclasses import replace +from pathlib import Path +from typing import Any + +from .checkpoints import load_checkpoint, predict_checkpoint, sha256_file +from .data import as_har_data, read_npz +from .methods import FIXED_METHODS, SEARCH_METHODS, SELECTION_METHODS, build_family, list_methods + + +def _json(payload: Any) -> str: + return json.dumps(payload, ensure_ascii=False, indent=2, default=str) + + +def _write_new(path: Path, payload: str) -> None: + path.parent.mkdir(parents=True, exist_ok=True) + with path.open("x", encoding="utf-8") as stream: + stream.write(payload + "\n") + + +def _metadata(args: argparse.Namespace, data: dict[str, Any]) -> dict[str, Any]: + path = args.metadata + if path is None: + candidates = [args.checkpoint.parent / "checkpoint.json", + args.checkpoint.with_name(args.checkpoint.stem + ".metadata.json")] + path = next((candidate for candidate in candidates if candidate.is_file()), None) + out = {} if path is None else json.loads(path.read_text(encoding="utf-8")) + if not isinstance(out, dict): + raise ValueError("Checkpoint metadata must be a JSON object") + if "label_names" in data: + if out.get("label_names") is not None and out["label_names"] != data["label_names"]: + raise ValueError("Input NPZ label_names differ from checkpoint metadata") + out.setdefault("label_names", data["label_names"]) + return out + + +def inventory(root: Path, manifest: Path | None = None) -> dict[str, Any]: + """Inspect model paths/status without loading a pickle or claiming usability.""" + manifest = manifest or root / "model_inventory.csv" + if manifest.is_file(): + with manifest.open(newline="", encoding="utf-8") as stream: + rows = list(csv.DictReader(stream)) + return {"manifest": str(manifest), "expected_cells": len(rows), + "source_status_counts": dict(Counter(row.get("source_status", "unknown") for row in rows)), + "method_counts": dict(Counter(row.get("method", "unknown") for row in rows)), + "note": "Inventory status is not a checkpoint load or prediction test.", + "models": rows} + if not root.is_dir(): + raise FileNotFoundError(root) + files = sorted(root.rglob("*.pkl")) + return {"root": str(root), "files_present": len(files), + "bytes_present": sum(path.stat().st_size for path in files), + "note": "Files present is not the same as verified usable models.", + "models": [{"model_path": str(path.relative_to(root)), "bytes": path.stat().st_size} + for path in files]} + + +def _predict(args: argparse.Namespace, *, evaluate: bool = False) -> dict[str, Any]: + import numpy as np + + if args.output.exists(): + raise FileExistsError(f"Refusing to overwrite {args.output}") + data = read_npz(args.input, require_y=evaluate) + metadata = _metadata(args, data) + model = load_checkpoint(args.checkpoint, trust_pickle=args.trust_pickle, + expected_sha256=args.sha256) + prediction = predict_checkpoint(model, data["X"], subject=data.get("subject"), + time_index=data.get("time_index"), metadata=metadata, + n_jobs=args.n_jobs) + if evaluate: + from wisp.core.metrics import classification_report_dict + from .scoring import score + + result = classification_report_dict(data["y"], prediction, + label_names=metadata.get("label_names")) + classes = getattr(model, "classes_", None) + n_classes = (len(metadata["label_names"]) if metadata.get("label_names") is not None + else int(np.max(classes)) + 1 if classes is not None and len(classes) + else int(max(np.max(data["y"]), np.max(prediction))) + 1) + result.update(score(data["y"], prediction, n_classes)) + result.update({"checkpoint": str(args.checkpoint), "input": str(args.input), + "decoder": "sequence" if getattr(model, "smoother_", None) is not None else "direct", + "metric_contract": "paper: macro_F1 on observed truth/prediction classes; worst_F1 on full global vocabulary", + "test_usage": "This command evaluates; it does not select or refit a model."}) + _write_new(args.output, _json(result)) + return result + arrays = {"y_pred": prediction} + for key in ("subject", "time_index"): + if key in data: + arrays[key] = data[key] + if metadata.get("label_names") is not None: + names = np.asarray(metadata["label_names"], dtype=str) + arrays["label_names"] = names + arrays["y_pred_name"] = names[prediction] + args.output.parent.mkdir(parents=True, exist_ok=True) + with args.output.open("xb") as stream: + np.savez_compressed(stream, **arrays) + return {"output": str(args.output), "n_predictions": len(prediction), + "decoder": "sequence" if getattr(model, "smoother_", None) is not None else "direct"} + + +def _training_plan(args: argparse.Namespace) -> dict[str, Any]: + result = {key: value for key, value in vars(args).items() if key != "execute"} + result["execute"] = bool(args.execute) + result["note"] = ("Training/search is enabled explicitly. Run on allocated compute resources." + if args.execute else "Plan only. Add --execute to fit/search on allocated compute resources.") + return result + + +def _fit(args: argparse.Namespace) -> dict[str, Any]: + if not args.execute: + return _training_plan(args) + metadata_path = args.output.with_name(args.output.stem + ".metadata.json") + for path in (args.output, metadata_path): + if path.exists(): + raise FileExistsError(f"Refusing to overwrite {path}") + data = read_npz(args.input, require_y=True) + dataset = as_har_data(data, n_classes=args.n_classes, source=str(args.input)) + overrides = {} if args.overrides is None else json.loads(args.overrides) + if not isinstance(overrides, dict): + raise ValueError("--overrides must be a JSON object") + model = build_family(args.method, seed=args.seed, n_jobs=args.n_jobs, + direct=args.direct, overrides=overrides) + if getattr(model, "use_hmm", False) and (dataset.subject is None or dataset.time_index is None): + raise ValueError("Sequence-decoder fitting requires both subject/session IDs and time_index; " + "use --direct only if intentionally fitting a different direct-decoder variant") + model.fit(dataset.X, dataset.y, groups=dataset.subject, time_index=dataset.time_index, + n_classes=dataset.n_classes) + args.output.parent.mkdir(parents=True, exist_ok=True) + with args.output.open("xb") as stream: + pickle.dump(model, stream, protocol=pickle.HIGHEST_PROTOCOL) + metadata = {"method_id": args.method, "input_shape": list(dataset.X.shape[1:]), + "label_names": dataset.label_names, "model_seed": args.seed, + "fit_scope": "explicit input NPZ; no automatic benchmark split or refit", + "use_hmm": getattr(model, "smoother_", None) is not None, + "source_status": "newly_fitted", "sha256": sha256_file(args.output), + "params": model.get_params(deep=False)} + _write_new(metadata_path, _json(metadata)) + return {"checkpoint": str(args.output), "metadata": str(metadata_path), + "sha256": metadata["sha256"], "fit_seconds": getattr(model, "fit_seconds_", None)} + + +def _select_fit(args: argparse.Namespace) -> dict[str, Any]: + if not args.execute: + return _training_plan(args) + from .selection import fit_selector + + metadata_path = args.output.with_name(args.output.stem + ".metadata.json") + selection_path = args.output.with_name(args.output.stem + ".selection.json") + for path in (args.output, metadata_path, selection_path): + if path.exists(): + raise FileExistsError(f"Refusing to overwrite {path}") + train, valid = [as_har_data(read_npz(path, require_y=True), n_classes=args.n_classes, + source=str(path)) for path in (args.train, args.valid)] + model, report = fit_selector(args.method, train, valid, seed=args.seed, n_jobs=args.n_jobs) + args.output.parent.mkdir(parents=True, exist_ok=True) + with args.output.open("xb") as stream: + pickle.dump(model, stream, protocol=pickle.HIGHEST_PROTOCOL) + metadata = {"method_id": args.method, "selected_method_id": report["selected_method_id"], + "input_shape": list(train.X.shape[1:]), "label_names": train.label_names, + "model_seed": args.seed, "fit_scope": "train+validation", + "use_hmm": getattr(model, "smoother_", None) is not None, + "source_status": "newly_fitted", "sha256": sha256_file(args.output), + "selection_uses_test": False} + _write_new(metadata_path, _json(metadata)) + _write_new(selection_path, _json(report)) + return {"checkpoint": str(args.output), "metadata": str(metadata_path), + "selection": str(selection_path), "selected_method_id": report["selected_method_id"], + "sha256": metadata["sha256"]} + + +def _search(args: argparse.Namespace) -> dict[str, Any]: + if not args.execute: + return _training_plan(args) + from wisp.search.controller import WISPSearchController + from wisp.search.profiles import get_profile + + if args.candidate_workers > args.n_jobs: + raise ValueError("candidate_workers cannot exceed the explicit total n_jobs budget") + if args.max_evaluations < args.population: + raise ValueError("max_evaluations must be at least the initial population") + parts = [as_har_data(read_npz(path, require_y=True), n_classes=args.n_classes, source=str(path)) + for path in (args.train, args.valid, args.test)] + for part in parts: + if part.subject is None or part.time_index is None: + raise ValueError("Search datasets require subject/session IDs and time_index") + if part.label_names != parts[0].label_names: + raise ValueError("Train/validation/test must share the same global label_names") + if part.X.shape[1:] != parts[0].X.shape[1:]: + raise ValueError("Train/validation/test must share the same time/channel shape") + groups = [set(part.subject.astype(str).tolist()) for part in parts] + if any(groups[first] & groups[second] for first, second in ((0, 1), (0, 2), (1, 2))): + raise ValueError("Participant/session leakage between train/validation/test") + # Users supply locked partitions; this command never invents a split, and + # selection stays on validation inside the preserved search controller. + profile = replace(get_profile(args.method), max_evaluations=args.max_evaluations) + controller = WISPSearchController( + train=parts[0], valid=parts[1], test=parts[2], output=args.output, + profile=profile, population=args.population, generations=args.generations, + seed=args.seed, candidate_workers=args.candidate_workers, + n_jobs_per_candidate=max(1, args.n_jobs // args.candidate_workers), + ) + result = controller.run() + model_path = args.output / "selected_model.pkl" + if model_path.is_file(): + sidecar = args.output / "selected_model.metadata.json" + metadata = {"method_id": args.method, "input_shape": list(parts[0].X.shape[1:]), + "label_names": parts[0].label_names, "model_seed": args.seed, + "fit_scope": "train+validation; selection uses validation only", + "sha256": sha256_file(model_path), "source_status": "newly_fitted", + "search_profile": profile.to_dict(), "selection_uses_test": False} + if not sidecar.exists(): + _write_new(sidecar, _json(metadata)) + return result + + +def _positive(value: str) -> int: + result = int(value) + if result < 1: + raise argparse.ArgumentTypeError("must be positive") + return result + + +def make_parser() -> argparse.ArgumentParser: + parser = argparse.ArgumentParser(prog="wisp", description="WISP method checkpoints and CPU workflows") + parser.add_argument("--version", action="version", version="WISP release 0.1.0") + sub = parser.add_subparsers(dest="command", required=True) + sub.add_parser("list", help="List the full paper method series; no model loads") + inv = sub.add_parser("inventory", help="Read inventory/file presence; no model loads") + inv.add_argument("--root", type=Path, default=Path("models")) + inv.add_argument("--manifest", type=Path) + for name in ("predict", "evaluate"): + command = sub.add_parser(name, help=f"{name.capitalize()} using an explicitly trusted fitted checkpoint") + command.add_argument("--checkpoint", type=Path, required=True) + command.add_argument("--input", type=Path, required=True) + command.add_argument("--output", type=Path, required=True) + command.add_argument("--trust-pickle", action="store_true") + command.add_argument("--sha256", help="Expected digest from an independently trusted source") + command.add_argument("--metadata", type=Path, help="JSON sidecar; checkpoint.json auto-detected when present") + command.add_argument("--n-jobs", type=_positive, default=1) + fit = sub.add_parser("family-fit", help="Plan or explicitly fit one of the seven fixed WISP families") + fit.add_argument("--method", choices=tuple(FIXED_METHODS), required=True) + fit.add_argument("--input", type=Path, required=True) + fit.add_argument("--output", type=Path, required=True) + fit.add_argument("--seed", type=int, required=True) + fit.add_argument("--n-jobs", type=_positive, required=True) + fit.add_argument("--n-classes", type=_positive) + fit.add_argument("--direct", action="store_true", help="Intentionally fit without the sequence decoder") + fit.add_argument("--overrides", help="Explicit JSON parameter overrides (changes the trained variant)") + fit.add_argument("--execute", action="store_true", help="Actually fit; otherwise print a plan only") + select = sub.add_parser("select-fit", help="Plan or explicitly select a fixed family on validation and refit once") + select.add_argument("--method", choices=tuple(SELECTION_METHODS), required=True) + select.add_argument("--train", type=Path, required=True) + select.add_argument("--valid", type=Path, required=True) + select.add_argument("--output", type=Path, required=True) + select.add_argument("--seed", type=int, required=True) + select.add_argument("--n-jobs", type=_positive, required=True) + select.add_argument("--n-classes", type=_positive) + select.add_argument("--execute", action="store_true", help="Actually select/refit; otherwise print a plan only") + search = sub.add_parser("search", help="Plan or explicitly run the preserved CPU search controller") + search.add_argument("--method", choices=tuple(SEARCH_METHODS), required=True) + for part in ("train", "valid", "test"): + search.add_argument(f"--{part}", type=Path, required=True) + search.add_argument("--output", type=Path, required=True) + search.add_argument("--population", type=_positive, required=True) + search.add_argument("--generations", type=_positive, required=True) + search.add_argument("--max-evaluations", type=_positive, required=True) + search.add_argument("--seed", type=int, required=True) + search.add_argument("--n-jobs", type=_positive, required=True, help="Total CPU thread budget") + search.add_argument("--candidate-workers", type=_positive, default=1) + search.add_argument("--n-classes", type=_positive) + search.add_argument("--execute", action="store_true", help="Actually search; otherwise print a plan only") + return parser + + +def main(argv: list[str] | None = None) -> int: + parser = make_parser() + args = parser.parse_args(argv) + try: + if args.command == "list": + result = list_methods() + elif args.command == "inventory": + result = inventory(args.root, args.manifest) + elif args.command in ("predict", "evaluate"): + result = _predict(args, evaluate=args.command == "evaluate") + elif args.command == "family-fit": + result = _fit(args) + elif args.command == "select-fit": + result = _select_fit(args) + else: + result = _search(args) + except (ValueError, TypeError, FileNotFoundError, FileExistsError, KeyError) as exc: + parser.error(str(exc)) + print(_json(result)) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/src/wisp_release/data.py b/src/wisp_release/data.py new file mode 100644 index 0000000000000000000000000000000000000000..086335e0a8c947d0c1246fe1696d0da6b2d6784a --- /dev/null +++ b/src/wisp_release/data.py @@ -0,0 +1,65 @@ +"""Read numeric NPZ input without allowing embedded Python pickles.""" + +from __future__ import annotations + +from pathlib import Path +from typing import Any + + +def read_npz(path: str | Path, *, require_y: bool = False) -> dict[str, Any]: + import numpy as np + + path = Path(path) + with np.load(path, allow_pickle=False) as archive: + if "X" not in archive: + raise ValueError("NPZ must contain X with shape (n_windows,n_timepoints,n_channels)") + if require_y and "y" not in archive: + raise ValueError("NPZ must contain encoded integer y for this command") + try: + out = {key: np.asarray(archive[key]) for key in + ("X", "y", "subject", "time_index", "label_names", "sampling_rate_hz") + if key in archive} + except ValueError as exc: + raise ValueError("NPZ object arrays are not supported; export numeric arrays and " + "Unicode strings, not pickled metadata") from exc + X = out["X"] + if X.ndim != 3 or not all(X.shape): + raise ValueError("X must have nonempty shape (n_windows,n_timepoints,n_channels)") + if "y" in out: + y = out["y"] + if y.ndim != 1 or len(y) != len(X) or not np.issubdtype(y.dtype, np.integer): + raise ValueError("y must be a one-dimensional integer array aligned with X") + if y.size and y.min() < 0: + raise ValueError("y must use nonnegative global class IDs") + for key in ("subject", "time_index"): + if key in out and (out[key].ndim != 1 or len(out[key]) != len(X)): + raise ValueError(f"{key} must be one-dimensional and aligned with X") + if "label_names" in out: + if out["label_names"].ndim != 1: + raise ValueError("label_names must be a one-dimensional global class vocabulary") + out["label_names"] = [str(value) for value in out["label_names"].tolist()] + if "y" in out and out["y"].size and out["y"].max() >= len(out["label_names"]): + raise ValueError("y is incompatible with label_names") + return out + + +def as_har_data(data: dict[str, Any], *, n_classes: int | None = None, source: str = "NPZ") -> Any: + import numpy as np + from wisp.core.data import HARData + + if "y" not in data: + raise ValueError("y is required to construct a training/evaluation dataset") + names = data.get("label_names") + if names is None: + if n_classes is None or n_classes < 1: + raise ValueError("Supply the global label_names in NPZ or explicit --n-classes; " + "a fold's observed labels must not redefine the class axis") + names = [str(index) for index in range(n_classes)] + elif n_classes is not None and n_classes != len(names): + raise ValueError("n_classes differs from the supplied label_names vocabulary") + if data["y"].size and data["y"].max() >= len(names): + raise ValueError("y contains a class ID outside the global vocabulary") + rate = data.get("sampling_rate_hz") + return HARData(X=data["X"], y=data["y"], subject=data.get("subject"), + time_index=data.get("time_index"), label_names=names, source=source, + sampling_rate_hz=None if rate is None else float(np.asarray(rate).reshape(-1)[0])) diff --git a/src/wisp_release/methods.py b/src/wisp_release/methods.py new file mode 100644 index 0000000000000000000000000000000000000000..5814791594fc014a45627dc29ccff9a2b5c36267 --- /dev/null +++ b/src/wisp_release/methods.py @@ -0,0 +1,59 @@ +"""Paper names and executable fixed-family constructors (no baselines).""" + +from __future__ import annotations + +from typing import Any + +FIXED_METHODS = { + "wisp_ss": "WISP-SS", + "wisp_rc": "WISP-RC", + "wisp_so": "WISP-SO", + "wisp_cse": "WISP-CSE", + "wisp_gis": "WISP-GIS", + "wisp_cis": "WISP-CIS", + "wisp_ese": "WISP-ESE", +} +SELECTION_METHODS = { + "wisp_select5": "WISP-Select5", + "wisp_select7": "WISP-Select7", +} +SEARCH_METHODS = { + "wisp_random": "WISP-Random", + "wisp_evolution": "WISP-Evolution", +} + + +def list_methods() -> list[dict[str, Any]]: + """Describe the full paper series without importing optional backends.""" + out: list[dict[str, Any]] = [] + for group, names in ( + ("fixed_family", FIXED_METHODS), + ("validation_selection", SELECTION_METHODS), + ("search", SEARCH_METHODS), + ): + for method_id, name in names.items(): + out.append({ + "method_id": method_id, + "paper_name": name, + "group": group, + "checkpoint_loading": True, + "family_fit": group == "fixed_family", + "select_fit": group == "validation_selection", + "search": group == "search", + }) + return out + + +def build_family(method_id: str, *, seed: int, n_jobs: int = 1, + direct: bool = False, overrides: dict[str, Any] | None = None) -> Any: + """Construct one fixed WISP family; construction does not fit it.""" + if method_id not in FIXED_METHODS: + raise ValueError(f"family-fit supports fixed families only: {', '.join(FIXED_METHODS)}") + if n_jobs < 1: + raise ValueError("n_jobs must be positive") + from wisp.registry import build_method + + params = dict(overrides or {}) + if direct: + params["use_hmm"] = False + return build_method(method_id, seed=seed, n_jobs=n_jobs, overrides=params) diff --git a/src/wisp_release/scoring.py b/src/wisp_release/scoring.py new file mode 100644 index 0000000000000000000000000000000000000000..f1ccae6c98c4fc1e6e27b9bd6f49b5820e96be53 --- /dev/null +++ b/src/wisp_release/scoring.py @@ -0,0 +1,42 @@ +"""Frozen paper score definitions, including full-vocabulary worst-class F1. + +Copied from the paper artifact's wristharbench/scoring.py; no baseline code is +needed. Macro F1 averages classes observed in truth or prediction; worst-class +F1 considers the full dataset vocabulary, including absent classes. +""" + +from __future__ import annotations + +from typing import Any + + +def from_confusion(confusion: Any) -> dict[str, Any]: + import numpy as np + + cm = np.asarray(confusion, dtype=float) + if cm.ndim != 2 or cm.shape[0] != cm.shape[1] or not np.isfinite(cm).all() or (cm < 0).any() or cm.sum() <= 0: + raise ValueError("Expected a nonempty square finite nonnegative confusion matrix") + truth, predicted = cm.sum(1), cm.sum(0) + tp = np.diag(cm) + denominator = truth + predicted + per_class = np.divide(2 * tp, denominator, out=np.zeros(len(tp)), where=denominator > 0) + recall = np.divide(tp, truth, out=np.zeros(len(tp)), where=truth > 0) + return {"macro_f1": float(per_class[denominator > 0].mean()), + "accuracy": float(tp.sum() / cm.sum()), + "balanced_accuracy": float(recall[truth > 0].mean()), + "worst_class_f1": float(per_class.min())} + + +def score(y_true: Any, y_pred: Any, n_classes: int) -> dict[str, Any]: + import numpy as np + from sklearn.metrics import confusion_matrix + + truth, prediction = np.asarray(y_true), np.asarray(y_pred) + if n_classes < 1 or truth.ndim != 1 or truth.shape != prediction.shape or not len(truth): + raise ValueError("Expected aligned nonempty labels and a positive global class count") + if not np.issubdtype(truth.dtype, np.integer) or not np.issubdtype(prediction.dtype, np.integer): + raise ValueError("Labels must be encoded integers") + if min(truth.min(), prediction.min()) < 0 or max(truth.max(), prediction.max()) >= n_classes: + raise ValueError("Labels fall outside the global class vocabulary") + cm = confusion_matrix(truth, prediction, labels=np.arange(n_classes)) + return {**from_confusion(cm), "confusion_matrix": cm.tolist()} diff --git a/src/wisp_release/selection.py b/src/wisp_release/selection.py new file mode 100644 index 0000000000000000000000000000000000000000..c9a395c1cb92ecd18ec438548c7012e536c36e5e --- /dev/null +++ b/src/wisp_release/selection.py @@ -0,0 +1,91 @@ +"""Validation-only WISP-Select5/Select7 and one final train+validation refit.""" + +from __future__ import annotations + +import math +from typing import Any, Callable + +from .checkpoints import predict_checkpoint +from .methods import FIXED_METHODS, build_family +from .scoring import score + +SELECTOR_ORDER = tuple(FIXED_METHODS) +SELECT5_FAMILIES = ("wisp_ss", "wisp_rc", "wisp_so", "wisp_gis", "wisp_cis") + + +def selection_key(record: dict[str, Any]) -> tuple[float, float, float, int]: + """Historical deterministic tie break: macro, worst F1, size, paper order.""" + macro = float(record["macro_f1"]) + worst = float(record["worst_class_f1"]) + size = float(record["model_size_mb"]) + if not all(math.isfinite(value) for value in (macro, worst, size)) or size < 0: + raise ValueError("Validation selection requires finite scores and nonnegative model sizes") + return (-macro, -worst, size, SELECTOR_ORDER.index(record["method_id"])) + + +def choose_validation_winner(records: list[dict[str, Any]]) -> str: + if not records: + raise ValueError("No validation candidates were evaluated") + return min(records, key=selection_key)["method_id"] + + +def _model_size_mb(model: Any) -> float: + # The original fixed-method runner called this preserved helper, which uses + # pickle's DEFAULT protocol (not HIGHEST_PROTOCOL). Renaming a Python module + # can change pickle byte counts: refits are not claimed binary-identical. + from wisp.cpu.algorithms import estimate_pickle_size_mb + + return estimate_pickle_size_mb(model) + + +def fit_selector(method_id: str, train: Any, valid: Any, *, seed: int, n_jobs: int = 1, + builder: Callable[..., Any] | None = None) -> tuple[Any, dict[str, Any]]: + """Fit/evaluate fixed families on validation, then refit the winner once. + + No test input is accepted. ``train`` and ``valid`` are HARData objects with + the same global vocabulary, shape and disjoint participant/session IDs. + ``builder`` is a testing/customization seam; default canonical settings are + the preserved paper registry. Changing a builder changes the experiment. + """ + import numpy as np + from wisp.core.data import concatenate_har + + if method_id not in ("wisp_select5", "wisp_select7"): + raise ValueError("Expected wisp_select5 or wisp_select7") + if train.label_names != valid.label_names or train.n_classes != valid.n_classes: + raise ValueError("Train/validation must share the same global label vocabulary") + if train.X.shape[1:] != valid.X.shape[1:]: + raise ValueError("Train/validation must share the same time/channel shape") + for data in (train, valid): + if data.subject is None or data.time_index is None: + raise ValueError("Selector requires subject/session IDs and time_index") + train_groups = set(np.asarray(train.subject).astype(str).tolist()) + valid_groups = set(np.asarray(valid.subject).astype(str).tolist()) + if train_groups & valid_groups: + raise ValueError("Participant/session leakage between train and validation") + eligible = SELECT5_FAMILIES if method_id == "wisp_select5" else SELECTOR_ORDER + builder = builder or build_family + candidates = [] + for family in eligible: + model = builder(family, seed=seed, n_jobs=n_jobs) + model.fit(train.X, train.y, groups=train.subject, time_index=train.time_index, + n_classes=train.n_classes) + prediction = predict_checkpoint(model, valid.X, subject=valid.subject, + time_index=valid.time_index, n_jobs=n_jobs) + candidates.append({"method_id": family, + **score(valid.y, prediction, valid.n_classes), + "model_size_mb": _model_size_mb(model)}) + winner = choose_validation_winner(candidates) + combined = concatenate_har(train, valid, source="train+validation") + model = builder(winner, seed=seed, n_jobs=n_jobs) + model.fit(combined.X, combined.y, groups=combined.subject, time_index=combined.time_index, + n_classes=combined.n_classes) + report = {"method_id": method_id, "selected_method_id": winner, + "validation_candidates": candidates, "fit_scope": "train+validation", + "selection_uses_test": False, "model_seed": seed, + "tie_break": ["higher validation macro_f1", "higher full-vocabulary worst_class_f1", + "smaller fitted model default-protocol pickle size", "canonical family order"], + "serialized_size_caveat": "Module namespace renaming may alter serialized byte counts; " + "refitted models are not claimed binary-identical to historical files.", + "canonical_family_order": list(SELECTOR_ORDER)} + return model, report