[FEAT] Refactor Training Cell #88
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem Statement
The training and evaluation code in the notebook lacks modularity, as evidenced in cell 43 of stft.ipynb. This repetition of logic for sensor processing makes the workflow cumbersome and manual comparison inefficient.
Proposed Solution
Alternatives Considered
I considered leaving the code as-is or writing separate functions for each sensor. However, a single refactored function that accepts the sensor label as a parameter simplifies the code and encourages reusability.
Component
Priority
Implementation Ideas
train_and_evaluate_modelthat encapsulates model fitting, prediction, and accuracy calculation."sensor1"or"sensor2") and outputs a dictionary with keys likemodel,sensor, andaccuracy.Expected Benefits
train_and_evaluate_modelencapsulates timing, training, and evaluation."sensor1"or"sensor2") in the output, clearly associate a given model's performance with a specific sensor.Additional Context