Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Lopa10ko opened this issue Apr 17, 2024 · 1 comment · Fixed by #1292
Closed

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

Lopa10ko opened this issue Apr 17, 2024 · 1 comment · Fixed by #1292
Assignees
Labels
bug Something isn't working

Comments

@Lopa10ko
Copy link
Collaborator

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

@Lopa10ko Lopa10ko added the bug Something isn't working label Apr 17, 2024
@Lopa10ko Lopa10ko self-assigned this Apr 17, 2024
@Lopa10ko
Copy link
Collaborator Author

similar to #1279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant