src.inference
inference.py
This script performs inference on new time-series data using a trained encoder and a logistic regression classifier. It accepts input files in .hdf5, .csv, or .xlsx format, segments the data, applies the scaler used during training, extracts latent representations with a Keras encoder, and predicts whether each segment corresponds to a ‘walk’ or ‘no_walk’ class using a trained scikit-learn classifier.
The output is a CSV file containing the segment ID, estimated start time, prediction, and mean of the latent vector.
Example
python inference.py –input new_data.hdf5 –encoder encoder_transformer.keras –classifier latent_classifier.pkl –scaler standard_scaler.pkl –output predictions.csv
Functions
|
Loads input data from .hdf5, .csv, or .xlsx files. |
|
Runs inference on input data using an encoder and a logistic classifier. |
|
Segments time-series data into overlapping windows. |