Add Working Milestone with Initial Results and Model Inference #82

Merged
nuluh merged 6 commits from feature/48-feat-refactor-stft-preprocessing-and-training-pipeline-into-importable-modules into main 2025-05-23 18:30:10 +00:00
nuluh commented 2025-05-23 18:16:00 +00:00 (Migrated from github.com)

This pull request introduces several updates to the stft.ipynb notebook, improving code clarity, modularity, and functionality, as well as minor configuration and documentation changes. The key changes include refactoring the data preparation and model training processes, updating the README.md file with instructions, and adding a new setting to the VS Code configuration.

Code Refactoring and Modularity Improvements:

  • Replaced iterative concatenation of dataframes with pandas.concat to improve performance and readability, and added checks for empty data lists (code/notebooks/stft.ipynb). [1] [2]
  • Introduced a new utility function create_ready_data from src.ml.model_selection to streamline data preparation for sensors (code/notebooks/stft.ipynb).
  • Updated model training code to use separate model instances for each sensor (rf_model1, rf_model2, etc.) for better clarity and maintainability (code/notebooks/stft.ipynb). [1] [2] [3] [4] [5] [6]

Configuration and Documentation Updates:

  • Added a new setting to .vscode/settings.json to set the Jupyter notebook file root to the workspace folder (.vscode/settings.json).
  • Updated README.md with instructions on how to run the stft.ipynb notebook, including installation steps (README.md).

Minor Code Adjustments:

  • Commented out unused imports and code to clean up the notebook (code/notebooks/stft.ipynb).
  • Renamed variables (ready_data1ready_data1a, x1x1a, etc.) for consistency and to avoid overwriting issues (code/notebooks/stft.ipynb). [1] [2] [3] [4] [5]

These changes collectively enhance the maintainability, clarity, and usability of the project while improving the workflow for data preparation and model evaluation.

This pull request introduces several updates to the `stft.ipynb` notebook, improving code clarity, modularity, and functionality, as well as minor configuration and documentation changes. The key changes include refactoring the data preparation and model training processes, updating the `README.md` file with instructions, and adding a new setting to the VS Code configuration. ### Code Refactoring and Modularity Improvements: * Replaced iterative concatenation of dataframes with `pandas.concat` to improve performance and readability, and added checks for empty data lists (`code/notebooks/stft.ipynb`). [[1]](diffhunk://#diff-8d79bb7b4277999923c858dfe6ed3ff4ff4e85c1781c3b8075d102dd5bf8c860L443-R453) [[2]](diffhunk://#diff-8d79bb7b4277999923c858dfe6ed3ff4ff4e85c1781c3b8075d102dd5bf8c860L457-R484) * Introduced a new utility function `create_ready_data` from `src.ml.model_selection` to streamline data preparation for sensors (`code/notebooks/stft.ipynb`). * Updated model training code to use separate model instances for each sensor (`rf_model1`, `rf_model2`, etc.) for better clarity and maintainability (`code/notebooks/stft.ipynb`). [[1]](diffhunk://#diff-8d79bb7b4277999923c858dfe6ed3ff4ff4e85c1781c3b8075d102dd5bf8c860L600-R637) [[2]](diffhunk://#diff-8d79bb7b4277999923c858dfe6ed3ff4ff4e85c1781c3b8075d102dd5bf8c860L619-R657) [[3]](diffhunk://#diff-8d79bb7b4277999923c858dfe6ed3ff4ff4e85c1781c3b8075d102dd5bf8c860L644-R675) [[4]](diffhunk://#diff-8d79bb7b4277999923c858dfe6ed3ff4ff4e85c1781c3b8075d102dd5bf8c860L678-R711) [[5]](diffhunk://#diff-8d79bb7b4277999923c858dfe6ed3ff4ff4e85c1781c3b8075d102dd5bf8c860L695-R729) [[6]](diffhunk://#diff-8d79bb7b4277999923c858dfe6ed3ff4ff4e85c1781c3b8075d102dd5bf8c860L712-R747) ### Configuration and Documentation Updates: * Added a new setting to `.vscode/settings.json` to set the Jupyter notebook file root to the workspace folder (`.vscode/settings.json`). * Updated `README.md` with instructions on how to run the `stft.ipynb` notebook, including installation steps (`README.md`). ### Minor Code Adjustments: * Commented out unused imports and code to clean up the notebook (`code/notebooks/stft.ipynb`). * Renamed variables (`ready_data1` → `ready_data1a`, `x1` → `x1a`, etc.) for consistency and to avoid overwriting issues (`code/notebooks/stft.ipynb`). [[1]](diffhunk://#diff-8d79bb7b4277999923c858dfe6ed3ff4ff4e85c1781c3b8075d102dd5bf8c860L324-R326) [[2]](diffhunk://#diff-8d79bb7b4277999923c858dfe6ed3ff4ff4e85c1781c3b8075d102dd5bf8c860L361-R363) [[3]](diffhunk://#diff-8d79bb7b4277999923c858dfe6ed3ff4ff4e85c1781c3b8075d102dd5bf8c860L382-R391) [[4]](diffhunk://#diff-8d79bb7b4277999923c858dfe6ed3ff4ff4e85c1781c3b8075d102dd5bf8c860L394-R407) [[5]](diffhunk://#diff-8d79bb7b4277999923c858dfe6ed3ff4ff4e85c1781c3b8075d102dd5bf8c860L412-R429) These changes collectively enhance the maintainability, clarity, and usability of the project while improving the workflow for data preparation and model evaluation.
Sign in to join this conversation.