Skip to content

[Bug]: NaN-filled predict from ETSModel operation on metric evaluation #1285

@Lopa10ko

Description

@Lopa10ko

Expected Behavior

Passed integration test:

def test_api_ts_forecasting_example():
forecast = run_ts_forecasting_example(dataset='salaries', timeout=2, with_tuning=False)
assert forecast is not None

Current Behavior

Predictions on the metric evaluation process of a ETSModel end up being NaN-containing:

def predict(self, input_data):
input_data = copy(input_data)
idx = input_data.idx
start_id = idx[0]
end_id = idx[-1]
predictions = self.model.predict(start=start_id,
end=end_id)

Possible Solution

Maybe with a multiplicative trend these lines in statsmodels are raising some kind of exception (e.g. zero-devision) with a small enough endog values.

Steps to Reproduce

You can add the following code in api_forecasting.py:

def run_ts_forecasting_example(dataset='australia', horizon: int = 30, timeout: float = None,
                               visualization=False, validation_blocks=2, with_tuning=True):
    train_data, test_data, label = get_ts_data(dataset, horizon, validation_blocks=validation_blocks)
    # init model for the time series forecasting
    pipeline = Pipeline().load('<PATH_TO_PIPELINE>')
    model = Fedot(problem='ts_forecasting',
                  task_params=Task(TaskTypesEnum.ts_forecasting,
                                   TsForecastingParams(forecast_length=horizon)).task_params,
                  timeout=timeout,
                  n_jobs=-1,
                  metric='mae',
                  with_tuning=with_tuning.
                  initial_assumption=pipeline)
    ...

Here is one of a troubled pipelines: 0_pipeline_saved.zip

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions