src.export_balanced_chunks
export_balanced_chunks.py
Version that: - Processes sensor segment .xlsx files. - Computes modulus of acceleration,gyroscope and magnetometer, keeps S0–S2. - Truncates to median length. - Discards chunks longer than 125% of the median. - Balances class samples. - Saves output as a .hdf5 dataset (X, y) for training.
- Usage:
python export_balanced_chunks.py –input output/ –output data_balanced/ –verbose 2
Functions
|
Compute ModA, ModG, ModM from raw accelerometer, gyroscope and magnetometer data. |
|
Main entry point to export balanced sensor chunks as an HDF5 dataset. |
|
Save the preprocessed data into an HDF5 file. |