"ValueWarning: No supported index is available. Prediction results will be given with an integer index beginning at `start`. return get_prediction_index(" #549
I updated from 2.0.2 to 2.0.3, and now I am unable to call the predict() method on my SARIMAX model without getting the following warning:
C:\Users\Owner\anaconda3\envs\x0\lib\site-packages\statsmodels\tsa\base\tsa_model.py:834: ValueWarning: No supported index is available. Prediction results will be given with an integer index beginning atstart. return get_prediction_index(
"This is because you could have any kind of integer index; while the one you gave [3, 4, 5, 6, 7, 8] works with the logic you proposed, we could also have been given e.g. [2, -5, 18, 100, 22, 17], in which case it is not obvious what the "next" integer should be.
We do fully support / recommend RangeIndex since then it is always clear what the "next" value should be."
With this in mind, I changed the index of the DataFrame passed to predict() to a RangeIndex starting at 0 to conform to their standard, yet I am still thrown the same warning.
To Reproduce
Train a SARIMAX model.
Generate a pandas DataFrame comprised of 81 rows and 1 column comprised of floats called "sample_df"
Call the predict method as shown below.
mod.predict(sample_df.shape[0], sample_df)
I expected the the predict() method to run without a problem as it had always done, returning me the model's predicted values.
Actual Behavior
The predict() method throws the aforementioned warning every time it calculates. In the context of a simulation with thousands of runs, it slows everything down prohibitively.
Additional Context
The abrupt nature in which the warning ends " return get_prediction_index(" seems like it may be instructive.
Describe the bug
I updated from 2.0.2 to 2.0.3, and now I am unable to call the predict() method on my SARIMAX model without getting the following warning:
C:\Users\Owner\anaconda3\envs\x0\lib\site-packages\statsmodels\tsa\base\tsa_model.py:834: ValueWarning: No supported index is available. Prediction results will be given with an integer index beginning at
start. return get_prediction_index(
I found this bug report from statsmodels discussing this issue: https://github.com/statsmodels/statsmodels/issues/8487
The developer there says the following:
With this in mind, I changed the index of the DataFrame passed to predict() to a RangeIndex starting at 0 to conform to their standard, yet I am still thrown the same warning.
To Reproduce
mod.predict(sample_df.shape[0], sample_df)
Versions
Expected Behavior
I expected the the predict() method to run without a problem as it had always done, returning me the model's predicted values.
Actual Behavior
The predict() method throws the aforementioned warning every time it calculates. In the context of a simulation with thousands of runs, it slows everything down prohibitively.
Additional Context
The abrupt nature in which the warning ends " return get_prediction_index(" seems like it may be instructive.