-
Notifications
You must be signed in to change notification settings - Fork 1
✨ switch to Huber Regression with L2 normalization for sliding window method #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7f170ea
35ad2b6
c0f4e61
b76a27d
25a1d7e
106387f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,11 +9,14 @@ | |||||||||
| from logging import getLogger | ||||||||||
|
|
||||||||||
| import numpy as np | ||||||||||
| import sklearn.linear_model | ||||||||||
|
||||||||||
| from scipy.interpolate import make_smoothing_spline | ||||||||||
| from scipy.stats import theilslopes | ||||||||||
|
|
||||||||||
| from .inference import bad_fit_stats | ||||||||||
|
|
||||||||||
| # from scipy.stats import theilslopes | ||||||||||
|
|
||||||||||
|
|
||||||||||
|
Comment on lines
+17
to
+19
|
||||||||||
| # from scipy.stats import theilslopes |
Copilot
AI
Feb 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commented-out code for Theil-Sen should be removed rather than left in place. Since this is a deliberate switch to HuberRegressor and the PR description indicates it's roughly twice as fast with similar results, the old code should be deleted to keep the codebase clean.
Copilot
AI
Feb 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment has a double hash '# #' which appears to be a formatting issue. This should be cleaned up to use a single '#' for consistency with standard Python comment formatting.
Copilot
AI
Feb 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment states "uses L2 regularization" but this is inaccurate. HuberRegressor uses L2 regularization as a penalty on the coefficients (controlled by the alpha parameter), but the main feature is that it uses the Huber loss function for robustness to outliers, not L2 regularization. The comment should clarify that HuberRegressor is robust to outliers through the Huber loss function.
| # # Use HuberRegressor which uses L2 regularization and is twice as fast as | |
| # # Theil-Sen. | |
| # # Use HuberRegressor, which is robust to outliers via the Huber loss | |
| # # and is typically faster than Theil-Sen. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The outdated comments from the previous requirements.txt approach should be removed. These comments (lines 25-27, 28-29) reference the old approach and are now misleading since dependencies are now directly defined in the dependencies list.