We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
horizon=1
SARIMAX can't predict interval if horizon=1, it fails with an error:
AttributeError: 'int' object has no attribute 'startswith'
The problem is inside _SARIMAXAdapter.predict. If horizon=1, then returned forecast after casting to pd.DataFrame hasn't "predicted_mean" column.
_SARIMAXAdapter.predict
pd.DataFrame
No error.
import pandas as pd from etna.datasets import TSDataset from etna.models import SARIMAXModel from etna.pipeline import Pipeline HORIZON = 7 def main(): df = pd.read_csv("examples/data/example_dataset.csv", parse_dates=["timestamp"]) ts = TSDataset(df=TSDataset.to_dataset(df), freq="D") train_ts, test_ts = ts.train_test_split(test_size=HORIZON) # sarimax sarimax_pipeline = Pipeline(model=SARIMAXModel(), quantiles=[0.025, 0.1, 0.4, 0.9, 0.975], horizon=1) sarimax_pipeline.fit(ts=train_ts) forecast_sarimax = sarimax_pipeline.forecast(prediction_interval=True) if __name__ == "__main__": main()
No response
The text was updated successfully, but these errors were encountered:
Ama16
Successfully merging a pull request may close this issue.
🐛 Bug Report
SARIMAX can't predict interval if
horizon=1
, it fails with an error:The problem is inside
_SARIMAXAdapter.predict
. Ifhorizon=1
, then returned forecast after casting topd.DataFrame
hasn't "predicted_mean" column.Expected behavior
No error.
How To Reproduce
Environment
No response
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: