Skip to content
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

KTP-762 Implemented Linear Quantile Regression Model #529

Merged
merged 8 commits into from
Apr 3, 2024

Conversation

egordm
Copy link
Collaborator

@egordm egordm commented Mar 29, 2024

Following changes/features were added:

  • New LinearQuantile model. Used by specifying model="linear_quantile" in PredictionJob
  • Added feature filtering to ignore features deemed irrelevant.
  • Added data imputer transform to replace nans in data as linear model can not work with these.
  • Added tests for Linear Quantile Model.

Notes:

  • The model training quite a bit slower than XGBoost Quantile.
  • For each quantile a new SKLearn QuantileRegression model is trained.
  • Adding more features significantly impacts training time.

Here are some insights from the comparison notebook:

Feature Importance

Feature importance is more balanced now, possibly also because of the feature filtering:
image

image

Model also sees that AMI, AZI etc features make a nice base signal.

Forecasting

  • Model follows the load target more closely.
  • The quantiles do not cross.
  • The biggest quantile (0.9 in this image is better at forecasting peaks.
  • There are more false positives.
    image

@github-actions github-actions bot added the feature New feature or request label Mar 29, 2024
@egordm egordm requested a review from FrankKr March 29, 2024 12:15
@egordm egordm force-pushed the feature/linear-quantile-regression branch from c905ff9 to c6c34db Compare March 29, 2024 12:21
Copy link
Collaborator

@FrankKr FrankKr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good Egor!
Two minor comments.
And if you are feeling clean-code-minded, you could solve the issues SonarCloud lists:
https://sonarcloud.io/project/issues?id=OpenSTEF_openstef&pullRequest=529&resolved=false&inNewCodePeriod=true

openstef/feature_engineering/missing_values_transformer.py Outdated Show resolved Hide resolved
openstef/model/regressors/linear_quantile.py Show resolved Hide resolved
openstef/pipeline/train_model.py Show resolved Hide resolved
@egordm egordm force-pushed the feature/linear-quantile-regression branch from d5962cd to 52f1fdf Compare April 2, 2024 08:32
@egordm
Copy link
Collaborator Author

egordm commented Apr 2, 2024

Reevaluated benchmark for the linear model after recent change (code style fixes). And change in y scaling:

image

…ed documentation for MissingValueTransformer and LinearQuantile. Applied code fix suggestions from Sonarcloud.

Signed-off-by: Egor Dmitriev <[email protected]>
@egordm egordm force-pushed the feature/linear-quantile-regression branch from 20f59c7 to db10280 Compare April 2, 2024 09:15
Copy link

sonarcloud bot commented Apr 3, 2024

@egordm egordm merged commit 6d2ec80 into main Apr 3, 2024
6 checks passed
@egordm egordm deleted the feature/linear-quantile-regression branch April 3, 2024 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants