Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • F FEDOT
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 87
    • Issues 87
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ITMO-NSS-team
  • FEDOT
  • Issues
  • #368

Closed
Open
Created Jul 20, 2021 by Julia Borisova@chrislisbonContributor

Tests PipelineTuner for time series forecasting task with AR model fails for certain synthetic data

In some cases synthetic data generation (get_synthetic_ts_data_period) gives samples for which statsmodels AR fails.

test\unit\pipelines\test_pipeline_tuning.py:221 (test_ts_pipeline_with_stats_model)
def test_ts_pipeline_with_stats_model():
        """ Tests PipelineTuner for time series forecasting task with AR model """
        is_tuning_finished = True
        while is_tuning_finished:
            for i in range (500):
                print(f'Test n {i}')
                is_tuning_finished = False
                train_data, test_data = get_synthetic_ts_data_period()
    
                ar_pipeline = Pipeline(PrimaryNode('ar'))
    
                # Tune AR model
                tuner_ar = PipelineTuner(pipeline=ar_pipeline, task=train_data.task, iterations=5)
                tuned_ar_pipeline = tuner_ar.tune_pipeline(input_data=train_data,
>                                                          loss_function=mse)

test_pipeline_tuning.py:236: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\..\..\fedot\core\pipelines\tuning\unified.py:66: in tune_pipeline
    loss_params=loss_params)
..\..\..\fedot\core\pipelines\tuning\tuner_interface.py:125: in final_check
    loss_params=loss_params)
..\..\..\fedot\core\pipelines\tuning\tuner_interface.py:73: in get_metric_value
    predicted_values = pipeline.predict(predict_input)
..\..\..\fedot\core\pipelines\pipeline.py:215: in predict
    result = self.root_node.predict(input_data=copied_input_data, output_mode=output_mode)
..\..\..\fedot\core\pipelines\node.py:176: in predict
    return super().predict(input_data, output_mode)
..\..\..\fedot\core\pipelines\node.py:104: in predict
    is_fit_pipeline_stage=False)
..\..\..\fedot\core\operations\operation.py:116: in predict
    is_fit_pipeline_stage=is_fit_pipeline_stage)
..\..\..\fedot\core\operations\evaluation\time_series.py:62: in predict
    is_fit_pipeline_stage)
..\..\..\fedot\core\operations\evaluation\operation_implementations\models\ts_implementations.py:240: in predict
    end=end_id)
C:\Users\yulas\AppData\Roaming\Python\Python37\site-packages\statsmodels\base\wrapper.py:113: in wrapper
    obj = data.wrap_output(func(results, *args, **kwargs), how)
C:\Users\yulas\AppData\Roaming\Python\Python37\site-packages\statsmodels\tsa\ar_model.py:2187: in predict
    exog_oos=exog_oos,
C:\Users\yulas\AppData\Roaming\Python\Python37\site-packages\statsmodels\tsa\ar_model.py:753: in predict
    params, start, end, num_oos, exog, exog_oos
C:\Users\yulas\AppData\Roaming\Python\Python37\site-packages\statsmodels\tsa\ar_model.py:648: in _static_predict
    out_of_sample = self._static_oos_predict(params, num_oos, exog_oos)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <statsmodels.tsa.ar_model.AutoReg object at 0x000001DAE9EE59C8>
params = array([0.24502213, 0.26224372, 0.27110584]), num_oos = 5
exog_oos = None

    def _static_oos_predict(self, params, num_oos, exog_oos):
        new_x = self._setup_oos_forecast(num_oos, exog_oos)
        if self._maxlag == 0:
            return new_x @ params
        forecasts = np.empty(num_oos)
        nexog = 0 if self.exog is None else self.exog.shape[1]
        ar_offset = self._x.shape[1] - nexog - self._lags.shape[0]
        for i in range(num_oos):
            for j, lag in enumerate(self._lags):
                loc = i - lag
>               val = self._y[loc] if loc < 0 else forecasts[loc]
E               IndexError: index -644 is out of bounds for axis 0 with size 346
Assignee
Assign to
Time tracking