diff --git a/test/integration/models/test_custom_model_introduction.py b/test/integration/models/test_custom_model_introduction.py index c5514f2b5b..a7be5c2c77 100644 --- a/test/integration/models/test_custom_model_introduction.py +++ b/test/integration/models/test_custom_model_introduction.py @@ -147,7 +147,7 @@ def get_simple_pipeline(multi_data): exog_list.append(PipelineNode(data_id)) if 'hist_' in data_id: lagged_node = PipelineNode('lagged', nodes_from=[PipelineNode(data_id)]) - lagged_node.parameters = {'window_size': 1} + lagged_node.parameters = {'window_size': 2} hist_list.append(lagged_node) diff --git a/test/integration/pipelines/tuning/test_pipeline_tuning.py b/test/integration/pipelines/tuning/test_pipeline_tuning.py index 34cdb062ab..60116d7098 100644 --- a/test/integration/pipelines/tuning/test_pipeline_tuning.py +++ b/test/integration/pipelines/tuning/test_pipeline_tuning.py @@ -2,6 +2,8 @@ from time import time import pytest + +from fedot.core.repository.dataset_types import DataTypesEnum from golem.core.tuning.hyperopt_tuner import get_node_parameters_for_hyperopt from golem.core.tuning.iopt_tuner import IOptTuner from golem.core.tuning.optuna_tuner import OptunaTuner @@ -216,6 +218,20 @@ def run_pipeline_tuner(train_data, cv=None, iterations=3, early_stopping_rounds=None, **kwargs): + + if train_data.data_type in (DataTypesEnum.ts, DataTypesEnum.multi_ts): + forecast_length = train_data.task.task_params.forecast_length + folds = cv or 1 + validation_blocks = 1 + max_window = int(train_data.features.shape[0] / (folds + 1)) - (forecast_length * validation_blocks) - 1 + ssp = {'window_size': {'hyperopt-dist': hp.uniformint, 'sampling-scope': [2, max_window], 'type': 'discrete'}} + if search_space.custom_search_space is None: + search_space.custom_search_space = {'lagged': ssp} + else: + search_space.custom_search_space['lagged'] = ssp + search_space.replace_default_search_space = True + search_space.parameters_per_operation = search_space.get_parameters_dict() + # Pipeline tuning pipeline_tuner = TunerBuilder(train_data.task) \ .with_tuner(tuner) \ diff --git a/test/integration/real_applications/test_examples.py b/test/integration/real_applications/test_examples.py index dfb0a7d75e..bb9e6b2cb4 100644 --- a/test/integration/real_applications/test_examples.py +++ b/test/integration/real_applications/test_examples.py @@ -1,3 +1,5 @@ +import os + from datetime import timedelta import numpy as np @@ -45,8 +47,10 @@ def test_gapfilling_example(): def test_exogenous_ts_example(): path = fedot_project_root().joinpath('test/data/simple_sea_level.csv') + test = os.environ.pop('PYTEST_CURRENT_TEST') run_exogenous_experiment(path_to_file=path, len_forecast=50, with_exog=True) + os.environ['PYTEST_CURRENT_TEST'] = test def test_nemo_multiple_points_example(): @@ -84,7 +88,9 @@ def test_api_example(): prediction = run_classification_example(timeout=1, with_tuning=with_tuning) assert prediction is not None + test = os.environ.pop('PYTEST_CURRENT_TEST') forecast = run_ts_forecasting_example(dataset='australia', timeout=2, with_tuning=with_tuning) + os.environ['PYTEST_CURRENT_TEST'] = test assert forecast is not None pareto = run_classification_multiobj_example(timeout=1, with_tuning=with_tuning) diff --git a/test/integration/real_applications/test_model_result_reproducing.py b/test/integration/real_applications/test_model_result_reproducing.py index 7e4f58ad6b..03082438e7 100644 --- a/test/integration/real_applications/test_model_result_reproducing.py +++ b/test/integration/real_applications/test_model_result_reproducing.py @@ -31,7 +31,8 @@ def get_fitted_fedot(forecast_length, train_data, **kwargs): 'seed': 1, 'timeout': None, 'pop_size': 50, - 'num_of_generations': 5} + 'num_of_generations': 5, + 'with_tuning': False} params.update(kwargs) fedot = Fedot(**params) fedot.fit(train_data) diff --git a/test/integration/utilities/test_pipeline_import_export.py b/test/integration/utilities/test_pipeline_import_export.py index 1fa7fae267..2db2652a8c 100644 --- a/test/integration/utilities/test_pipeline_import_export.py +++ b/test/integration/utilities/test_pipeline_import_export.py @@ -346,7 +346,7 @@ def test_export_without_path_correctly(): def test_data_model_types_forecasting_pipeline_fit(): - train_data, test_data = get_ts_data(forecast_length=10) + train_data, test_data = get_ts_data(n_steps = 200, forecast_length=10) pipeline = get_multiscale_pipeline() pipeline.fit(train_data)