winedarksea / AutoTS

Automated Time Series Forecasting
MIT License
1.1k stars 100 forks source link

Fatal error on SeasonalityMotifImputer transformer #218

Open emobs opened 9 months ago

emobs commented 9 months ago

Sorry, hope these are true bugs and I'm not spamming you with errors here...

While running this model following the CurrentModels saved file: {"model_number": 68, "model_name": "LastValueNaive", "model_param_dict": {}, "model_transform_dict": {"fillna": "SeasonalityMotifImputer", "transformations": {"0": "AlignLastValue", "1": "SinTrend"}, "transformation_params": {"0": {"rows": 1, "lag": 2, "method": "additive", "strength": 1.0, "first_value_only": false}, "1": {}}}}

The transformer throws an error: autots/evaluator/auto_model.py:1152: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead

With a narrower transformer list this error is not thrown so I'm sure the transformer is the cause. Please let me know if you need more information.

--edit-- Also on the SeasonalityMotifImputerLinMix transformer this error is thrown.

winedarksea commented 9 months ago

This worked just fine:

import numpy as np
from autots import load_daily
df = load_daily(long=False)
from autots import model_forecast
trans_params = {"fillna": "SeasonalityMotifImputer", "transformations": {"0": "AlignLastValue", "1": "SinTrend"}, "transformation_params": {"0": {"rows": 1, "lag": 2, "method": "additive", "strength": 1.0, "first_value_only": False}, "1": {}}}
df.iloc[100] = np.nan
prediction = model_forecast(
    df_train=df,
    forecast_length=28,
    model_name="LastValueNaive",
    model_param_dict={},
    model_transform_dict=trans_params,
)
prediction.plot_grid(df)

given that the error is in auto_model.py this is likely not a transformer issue but a higher level AutoTS bug

winedarksea commented 9 months ago

The error is originating in unpack_ensemble_models according to your code.