Repository navigation
Conversation
Accept a tuple of dates as well as a proportion, placing potential changepoints among the history dates in that window. Serialize the tuple so model_to_json keeps working.
|
Hi @Skpkush! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Closes #1987
What
changepoint_rangenow accepts a(start, end)tuple of dates as well as a proportion. Potential changepoints are placed evenly among the history dates in that window, inclusive. Float behaviour is unchanged.This follows @tcuongd's suggestion on the issue to extend
changepoint_rangerather than add new__init__arguments.Details
pd.Timestampaccepts, and are stored as Timestamps. Bare numbers are rejected, becausepd.Timestampwould read them as epoch offsets.model_to_json/model_from_jsonnow handle the tuple, since Timestamps aren't JSON serializable.n_changepoints,n_changepointsis reduced, as it already is for proportions.fitraisesValueError.Questions for review
cross_validationkeeps the window fixed, so a cutoff earlier thanstartraises theValueErrorabove. I chose an error over silently fitting with no changepoints. Would you prefer a warning?Testing
pytest prophet/tests/: 150 passed, 6 skipped, on Windows with Python 3.11 and the CMDSTANPY backend.n_changepoints, a window outside the history, invalid input and a JSON round trip.cross_validationwith a date window.