-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add optional regressor predictor models and propagate their uncertainty #2703
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: tcuongd <29808430+tcuongd@users.noreply.github.com>
Co-authored-by: tcuongd <29808430+tcuongd@users.noreply.github.com>
| m.fit(df) | ||
| assert m.extra_regressors["constant_feature"]["std"] == 1 | ||
|
|
||
| def test_regressor_predictor_used_for_future(self, backend, monkeypatch): |
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.
@copilot Add tests that assert the values of the .predict() and cross_validate() outputs when using the regressor predictors.
These outputs should also be compared to the outputs when not using the regressor predictors. For example, you may generate some fake data that is fairly easy to predict accurately (when the default Prophet parameters are used) and use that as the exogenous regressor.
Aside from comparing point estimates, also make assertions on uncertainty (i.e. uncertainty should be larger when using regressor predictors), and metrics (i.e. cross validation metrics should be a little worse when using regressor predictors).
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.
Added compare-tests for regressor predictors vs point regressor values covering point accuracy, uncertainty widening, and cross-validation RMSE degradation (commit 1eb56e8).
| list(getattr(model, attribute).keys()), | ||
| getattr(model, attribute), | ||
| ] | ||
| if attribute == 'extra_regressors': |
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.
@copilot Write a test for serialization & deserialization of a model with exogenous regressor predictors.
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.
Added serialization/deserialization coverage for models with regressor predictors (commit 1eb56e8).
Co-authored-by: tcuongd <29808430+tcuongd@users.noreply.github.com>
tcuongd
left a comment
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.
@copilot Nice, you've covered RMSE degredation and uncertainty widening, but not point accuracy from what I can see. Remember, you can generate a time series from an equation for the exogenous regressors if that makes it easier to assert that the predictions fall within some range.
Also, when I asked to check the cross_validate() outputs, I meant check the metrics returned by that function. The test should live in test_diagnostics.
It's clear from your test that we don't handle serializing exogenous regressor predictors that have already been fit. Is this intended, and if so, why? What would it take to serialize fitted models and load their parameters?
Co-authored-by: tcuongd <29808430+tcuongd@users.noreply.github.com>
Point accuracy now asserted via synthetic regressor/y series (predict MAE vs actual/clean bounded) and CV metrics compared in test_diagnostics; added to commit e0a0f0d. Serialization keeps predictors unset intentionally because submodels include backend-specific fit objects; serializing fitted predictors would require persisting their params/Stan fit and backend, which is currently out of scope for lightweight model JSON. |
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.