Commit Graph

56 Commits

Author SHA1 Message Date
nuluh
855114d633 refactor(notebooks): clean up imports, adjust damage case processing, and improve model training structure
- Removed unnecessary imports (os, pandas, numpy) from the STFT notebook.
- Adjusted the number of damage cases in the multiprocessing pool to correctly reflect the range.
- Updated model training code for Sensor B to ensure consistent naming and structure.
- Cleaned up commented-out code for clarity and maintainability.
2025-08-17 23:39:57 +07:00
nuluh
4a1c0ed83e feat(src): implement inference function with damage probability calculations and visualization
Closes #103
2025-08-17 22:21:17 +07:00
nuluh
274cd60d27 refactor(src): update generate_df_tuples function signature to include type hints for better clarity 2025-08-11 18:49:41 +07:00
nuluh
9f23d82fab fix(src): correct file writing method in process.stft.process_damage_case function to fix incorrect first column name
Closes #104
2025-08-11 13:17:46 +07:00
nuluh
a8288b1426 refactor(src): enhance compute_stft function with type hints, improved documentation by moving column renaming process from process_damage_case to compute_stft 2025-08-11 13:15:48 +07:00
nuluh
860542f3f9 refactor(src): restructure compute_stft function to be pure function and include return parameters and improve clarity 2025-08-10 20:02:45 +07:00
nuluh
0e28ed6dd0 feat(notebooks): add cross-dataset validation for Sensor A and Sensor B models
Closes #74
2025-07-28 16:41:54 +07:00
nuluh
9b018efc15 refactor(notebooks): update STFT notebook to improve clarity and structure of sensor evaluation sections 2025-07-24 17:00:31 +07:00
nuluh
086032c250 refactor(notebooks): clean up to be more readable notebooks 2025-07-18 19:28:43 +07:00
nuluh
f6c71739df refactor(ml): clean up model_selection.py by removing unused code and improving function structure 2025-07-18 19:27:46 +07:00
nuluh
18824e05c0 refactor(ml): update inference calls to use new model structure and improve clarity 2025-07-17 00:18:01 +07:00
nuluh
2504157b29 feat(src): replace convert.py to src/data_preprocessing.py and fix some functions prefix parameter 2025-07-02 03:25:18 +07:00
nuluh
5ba628b678 refactor(src): make compute_stft and process_damage_case to be pure function that explicitly need STFT arguments to be passed 2025-07-01 14:32:52 +07:00
nuluh
a93adc8af3 feat(notebooks): minimize stft.ipynb notebooks and add STFT data preview plot.
- Consolidated import statements for pandas and matplotlib.
- Updated STFT plotting for Sensor 1 and Sensor 2 datasets with improved visualization using pcolormesh.
- Enhanced subplot organization for better clarity in visual representation.
- Added titles and adjusted layout for all plots.
2025-06-30 01:36:44 +07:00
nuluh
c2df42cc2b feat(ml): add XGBoost model to inference options and update commented inference calls 2025-06-27 10:35:27 +07:00
nuluh
465ed121f9 feat(notebooks): training model with new alternative undamaged (label 0) data 2025-06-27 10:34:23 +07:00
nuluh
d6975b4817 feat(src): update damage base path and adjust test run logic for damage case processing for undamage case new method 2025-06-27 10:33:54 +07:00
nuluh
9921d7663b feat(src): add inference script for model evaluation 2025-06-24 14:08:38 +07:00
nuluh
459fbcc17a refactor(notebooks): visualization for sensor analysis and streamline data processing 2025-06-24 14:08:02 +07:00
nuluh
5041ee3feb feat(src): add confusion matrix plotting and label percentage calculation 2025-06-24 14:06:56 +07:00
nuluh
114ab849b9 feat(src): Add confusion matrix plotting function for model evaluation 2025-06-24 00:27:15 +07:00
nuluh
6196523ea0 feat(notebooks): Add confusion matrix plotting loop for Sensor 1 models 2025-06-21 01:10:03 +07:00
nuluh
18892c1188 WIP(notebooks): Add SVM with StandardScaler and PCA to sensor model definitions 2025-06-18 08:31:55 +07:00
nuluh
a7d8f1ef56 fix(data): Fix pool mapping to include undamaged case and add csv header separator line for Excel compatibility 2025-06-18 08:25:01 +07:00
nuluh
4b0819f94e feat(notebooks): Enhance STFT notebook and model selection functionality
- Updated paths in the STFT notebook to reflect new data files.
- Improved plotting aesthetics for combined plots and added grid lines.
- Introduced a 3D spectrogram visualization for better data representation.
- Refactored model training function to include error handling and model export functionality.
- Adjusted model training calls to include export paths for saved models. Closes #90
- Added additional markdown cells for better documentation and clarity in the notebook.
2025-06-12 03:35:21 +07:00
nuluh
7da3179d08 refactor(nb): Create and implement helper function train_and_evaluate_model 2025-05-29 22:57:28 +07:00
nuluh
254b24cb21 feat(viz): Update plotting for STFT data visualization with color map 'jet' and added color bar 2025-05-29 20:35:35 +07:00
Rifqi D. Panuluh
d151062115 Add Working Milestone with Initial Results and Model Inference (#82)
* wip: add function to create stratified train-test split from STFT data

* feat(src): implement working function for dataset B to create ready data from STFT files stft_files and add setup.py for package configuration

* feat(notebook): Update variable names for clarity, remove unused imports, and streamline data processing. Implement data concatenation using pandas concat for efficiency. Add validation steps for Dataset B and improve model training consistency across sensors.

* fix(.gitignore): add rule to ignore egg-info directories and ensure proper formatting

* docs(README): add instructions for running stft.ipynb notebook

* feat(notebook): Add evaluation metrics and confusion matrix visualizations for model predictions on Dataset B. Remove commented-out code and integrate data preparation using create_ready_data function.

---------

Co-authored-by: nuluh <dam.ar@outlook.com>
2025-05-24 01:30:10 +07:00
nuluh
c8509aa728 fix(notebooks): fix out of index stft plotting iteration 2025-04-22 10:55:34 +07:00
nuluh
db2947abdf fix(data): fix the incorrect output of scipy.stft() data to be pandas.DataFrame shaped (513,513) along with its frequencies as the index and times as the columns (transposed) instead of just the magnitude that being flattened out; add checks for empty data and correct file paths for sensor data loading.
Closes #43
2025-04-20 14:45:38 +07:00
nuluh
8ed1437d6d Merge branch 'main' of https://github.com/nuluh/thesis 2025-03-16 14:12:11 +07:00
nuluh
96556a1186 ```
No code changes detected.
```
2025-03-16 14:07:56 +07:00
nuluh
b890e556cf fix(notebook): correct execution counts and update file naming conventions for STFT processing
Closes #27
2025-03-11 19:08:56 +07:00
nuluh
fa6e1ff72b refactor(notebook): seperate process_stft function to individual code cell. 2025-03-08 11:04:37 +07:00
nuluh
a2e339a0a0 feat: Implement STFT verification for individual test runs against aggregated data 2024-12-13 16:30:06 +07:00
nuluh
2decff0cfb Closes #24
feat(stft): Implement STFT processing for vibration data with multiprocessing support to include all the data for training process instead of just using `TEST1` only
2024-12-13 16:29:08 +07:00
nuluh
8b4eedab8a Closes #26
feat: Specify `fs` when calling `scipy.signal.stft`
2024-12-09 00:49:25 +07:00
nuluh
832b6c49db feat(notebook): Implement STFT with Hann windowing. Closes #22 2024-10-21 19:08:46 +07:00
nuluh
9618714d3c feat: Prepare all damage cases vibration record data to be merged inside two variables "signal_sensor1" and "signal_sensor2". Closes #23 2024-10-19 15:32:05 +07:00
nuluh
2f54e91197 feat: Add absolute value option to time feature extraction 2024-09-03 15:39:44 +07:00
nuluh
758255a24e feat(notebooks): Implement Time-domain feature extraction with real data from QUGS 2024-09-03 12:52:40 +07:00
nuluh
0306f28a68 docs(notebooks): add extract_numbers docstring 2024-09-03 11:09:47 +07:00
nuluh
adde35ed7e feat(notebook): Normalize the data by calculating the relative value between two sensors. Along with it, MinMaxScaler and StandardScaler are applied and visualize with Seaborn's Pair Plot.
Closes #15
2024-09-01 14:50:04 +07:00
nuluh
79a0f82372 feat(notebook): add 'labels' column to feature extraction dataframe
Implement extraction of 'labels' from directory names and append as a new column in the dataframe during feature extraction. Adapted from the existing `build_features.py` script to enhance data usability in supervised learning models within the Jupyter notebook environment.

Closes #10
2024-08-20 15:28:19 +07:00
nuluh
de902b2a8c feat: Add launch.json for Python debugger configuration
This commit adds a new file, `.vscode/launch.json`, which contains the configuration for launching the Python debugger. The configuration includes the necessary attributes such as the debugger type, request type, program file, console type, and command-line arguments. This configuration allows developers to easily debug Python files in the integrated terminal.
2024-08-20 12:52:48 +07:00
nuluh
57c0e03a4f docs(script): Update time-domain feature extraction to skip header row separator char info 2024-08-20 12:52:48 +07:00
nuluh
8ab934fe1c feat(features): refactor feature extraction to handle multiple files and directories
- Modify `build_features` function to support iterative processing across nested directories, enhancing the system's ability to handle larger datasets and varied input structures.
- Replace direct usage of `FeatureExtractor` class with `ExtractTimeFeatures` function, which now acts as a wrapper to include this class, facilitating streamlined integration and maintenance of feature extraction processes.
- Implement `extract_numbers` function using regex to parse filenames and extract numeric identifiers, used for labels when training with SVM
- Switch output from `.npz` to `.csv` format in `build_features`, offering better compatibility with data analysis tools and readability.
- Update documentation and comments within the code to reflect changes in functionality and usage of the new feature extraction setup.

Closes #4
2024-08-20 12:52:06 +07:00
nuluh
55db5709a9 refactor(script): Add time-domain feature extraction functionality called ExtractTimeFeatures function returning features in {dictionary} that later called in build_features.py. This function will be called for each individual .csv. Each returning value later appended in build_features.py.
This function approach rather than just assigning class ensure the flexibility and enhance maintainability.
2024-08-19 13:20:14 +07:00
nuluh
d0db65011d style 2024-08-17 11:39:46 +07:00
nuluh
565de5d3a8 refactor(notebooks): Move relative import of FeatureExtraction to "Print Time-domain Feature" section for better context 2024-08-17 11:12:43 +07:00