Issues that occur when loading model files #2527
Open
+24
−8
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.
Hi. The issue below appears to occur when the Prophet model loads an existing trained model on time series data with constant values (e.g. a single value of 1).
An error occurs when loading the model using the original code block below. The same error occurs in experiments such as unit func(1) and unit func(10).
If a single value is used for model fitting as shown above, the Prophet model cannot learn the various statistical variabilities required for prediction. Therefore, some parameters may be set differently than expected.
Personally, I think this is what's causing the IndexError in the warm_start_params function.
That is, when a model is trained on constant-valued (non-volatile) data, some parameters may be set to scalar values or arrays of lower dimension than expected. (The above exception occurs if the expected value is a two-dimensional array, but is actually a one-dimensional array.)
This means that learning from data that only has constant values may result in some parameters (e.g. trend point (delta), seasonal component (beta)) being set differently than expected.
This means that the parameter can be set to a single value or an array of lower dimensions than expected.
Even if it is saved as a low-dimensional array, the model should be able to be loaded without error.
I registered this PR to update the above code to the official documentation.
Thank you always for creating Prophet.