winedarksea / AutoTS

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

Dynamic factor, VECM, VAR and FBProphet error #56

Closed AlfredoCandela closed 3 years ago

AlfredoCandela commented 3 years ago

When I try to train one of these models individually or in a group, I have the following errror:

KeyError: 'Inconceivable! Evaluation Metrics are missing and all models have failed, by an error in TemplateWizard or metrics. A new template may help, or an adjusted model_list.'

Here is a simplified version of my code, which employs random numbers instead of fixed numbers and has the same problem:

`import numpy as np from autots import AutoTS import pandas as pd import datetime from datetime import timedelta

Model configuration

model_list = [ 'DynamicFactor', 'VECM', 'VAR', 'FBProphet', ]

metric_weighting = { 'smape_weighting' : 0, 'mae_weighting' : 30, 'rmse_weighting' : 5, 'containment_weighting' : 0, 'runtime_weighting' : 5, 'spl_weighting': 0, 'contour_weighting': 0,
}

model = AutoTS(
forecast_length=1,
frequency='infer', prediction_interval=0.95, no_negatives=False, ensemble='simple', constraint=0, max_generations=300,
max_per_model_class=1, na_tolerance=0.25, validation_method='seasonal 14', model_list=model_list, models_to_validate=1, num_validations=6, drop_data_older_than_periods=14, n_jobs='auto', metric_weighting=metric_weighting, )

Build date list for the dataframe index

InitialDate=datetime.datetime(2013,1,6) DateFinal=datetime.datetime(2018,12,22) DaysNumber=(DateFinal-InitialDate).days+1 Dates=list() Date=InitialDate for dia in range(0,DaysNumber): Dates.insert(dia,Date) Date=Date + timedelta(days=1)

Load time series data

DFTimeSeries=pd.DataFrame(np.random.rand(len(Dates),1)) DFTimeSeries.index=Dates

Training

model = model.fit(DFTimeSeries,result_file='pickle') `

I am working with Python 3.8.5 64-bit with Conda

winedarksea commented 3 years ago

@AlfredoCandela Well, three of the models in question don't work because they are multivariate only models and you have only a univariate time series. Those are Dynamic Factor, VECM, and VAR. You can take that up with Statsmodels, which is the package they come with. FBProphet, however, should work on a univariate series, so that is a definite issue, thanks for pointing that out.

winedarksea commented 3 years ago

@AlfredoCandela FBProphet isn't working because you haven't installed FBProphet. With FBProphet installed this works just fine: https://facebook.github.io/prophet/docs/installation.html