Add multi label capabilities for regression and add hyperparameter search#8
Add multi label capabilities for regression and add hyperparameter search#8
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds significant functionality to EcoNetToolkit by introducing multi-label/multi-output prediction capabilities for both classification and regression tasks, along with a comprehensive hyperparameter tuning framework. The changes also include a major refactoring of the evaluation module and bug fixes for categorical data handling.
Key Changes
- Multi-output support: Models can now predict multiple target variables simultaneously, with automatic wrapping for models that don't natively support multi-output
- Hyperparameter tuning: New
hyperopt.pymodule with GridSearchCV/RandomizedSearchCV support, grouped cross-validation, and proper train/val/test splits - Evaluation refactoring: Split monolithic
eval.pyinto modular components (metrics.py,plotting.py,feature_importance.py,reporting.py)
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_models.py | Adds tests for multi-output model wrapping behavior |
| tests/test_integration.py | Integration tests for multi-output classification and regression pipelines |
| tests/test_hyperopt.py | Comprehensive test suite for hyperparameter tuning functionality |
| tests/test_eval.py | Tests for multi-output metrics computation and evaluation |
| tests/test_data.py | Tests for multi-label data loading and splitting |
| run.py | Main script updated to support tuning mode, CV mode, and regular mode |
| ecosci/trainer.py | Adds run_cv() and run_with_tuning() methods for new training modes |
| ecosci/models.py | Implements wrap_for_multioutput() for automatic multi-output wrapping |
| ecosci/hyperopt.py | New module providing hyperparameter tuning for all model types |
| ecosci/evaluation/*.py | Refactored evaluation code into modular structure |
| ecosci/data.py | Multi-label support, grouped splits, and CV fold preparation |
| ecosci/init.py | Updated imports to use new evaluation module |
| configs/*.yaml | Example configurations for multi-label prediction |
| README.md | Documentation updates for new features |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 27 out of 27 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Some bug fixes for categorical data also included.
Multi label for classification also included.
Long files broken up.