aimclub / FEDOT

Automated modeling and machine learning framework FEDOT
https://fedot.readthedocs.io
BSD 3-Clause "New" or "Revised" License
619 stars 84 forks source link

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

Closed Lopa10ko closed 1 month ago

Lopa10ko commented 2 months ago

Expected Behavior

Passed integration test: https://github.com/aimclub/FEDOT/blob/0bdece11af60d6e9abc84a894ddd66ea960b5611/test/integration/real_applications/test_examples.py#L86-L88

Current Behavior

Predictions on the metric evaluation process of a ETSModel end up being NaN-containing: https://github.com/aimclub/FEDOT/blob/0bdece11af60d6e9abc84a894ddd66ea960b5611/fedot/core/operations/evaluation/operation_implementations/models/ts_implementations/statsmodels.py#L276-L283

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

Lopa10ko commented 2 months ago

similar to #1279