Enhanced Data Handling and Multi-Sensor Integration #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR upgrades the existing Random Forest–based activity recognition pipeline with robust data-handling improvements and multi-sensor fusion capabilities.
It modernizes the codebase for Python 3 + latest scikit-learn (≥1.3) and improves data reliability, model accuracy, and maintainability.
**Key Enhancements
🧠 Data Handling**
Added automatic missing value detection and imputation using SimpleImputer(strategy='median').
Implemented feature scaling/normalization with StandardScaler to improve model convergence and consistency.
Added robust preprocessing pipeline shared across all sensors for reproducibility.
⚙️ Model Improvements
Integrated GridSearchCV for automatic hyperparameter tuning (n_estimators, criterion, max_depth).
Implemented feature importance extraction and visualization for better interpretability.
Added normalized confusion matrix heatmaps for performance diagnostics.
🔄 Multi-Sensor Fusion
Combined wrist, hip, thigh, ankle, and upper arm datasets into a unified multi-sensor model.
Trains and evaluates this fusion model alongside individual sensor models.
Generates summary report comparing cross-sensor performance.
🧩 Code Modernization
Fully updated deprecated scikit-learn modules (cross_validation, grid_search → model_selection).
Structured into modular, reusable functions for easier maintenance.
Added model persistence via joblib for future inference.
Added warnings suppression, error handling, and clean console output.
Results
Stronger model robustness due to proper handling of missing data and feature scaling.
Improved interpretability with automatic feature importance visualization.
Cleaner, reproducible training pipeline for all sensors and combined models.