Refactor Training Cell #89
Reference in New Issue
Block a user
Delete Branch "feature/88-refactor-training-cell"
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?
This pull request refactors the
code/notebooks/stft.ipynbfile to simplify the codebase, improve maintainability, and enhance the clarity of model training and evaluation logic. The changes include consolidating repetitive code into reusable functions, restructuring the model definitions, and improving the visualization process.Code Simplification and Refactoring:
Consolidated repetitive model training and evaluation logic into a reusable function
train_and_evaluate_model, reducing code duplication and improving readability.Restructured model definitions into dictionaries (
models_sensor1andmodels_sensor2) for each sensor, allowing dynamic iteration over models and enhancing flexibility.Visualization Enhancements:
prepare_plot_dataandplot_accuraciesto streamline the process of generating bar plots for model accuracies across sensors. This improves modularity and reduces clutter.Code Cleanup: