Feat/improvements#9
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the StandardScaler and BaseModel classes to work with NumPy arrays instead of Pandas DataFrames, improving performance and simplifying the API. The changes also standardize the column naming convention for one-hot encoded calendar features.
- Migrated StandardScaler from DataFrame-based to NumPy array-based implementation
- Optimized BaseModel data slicing by pre-grouping data by hour and using boolean masks
- Updated calendar feature column naming from specific prefixes (weekday_, hour_, month_) to a unified "is_" prefix
- Added error handling for concurrent task execution
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| epftoolbox2/scalers/standard.py | Refactored to use NumPy arrays instead of DataFrames, added static method for scalable column detection |
| epftoolbox2/models/base.py | Optimized data slicing with pre-computed hour groups, added error handling for concurrent tasks, converted to NumPy arrays |
| epftoolbox2/models/ols.py | Set fit_intercept=False for LinearRegression (appropriate for standardized data) |
| epftoolbox2/data/sources/calendar.py | Changed one-hot encoding prefix from feature-specific (weekday_, hour_, month_) to unified "is_" prefix |
| tests/scalers/test_standard.py | Updated tests to work with NumPy arrays instead of DataFrames |
| tests/data/sources/test_calendar.py | Updated column detection logic to match new "is_" prefix naming convention |
| .gitignore | Broadened patterns from specific files to more general patterns (main[1-9]*.py, *.jsonl) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
@copilot write summary and review