code: def run_multiple_ts_forecasting(forecast_length, is_multi_ts):
      # separate data on test/train
      train_data, test_data, task = prepare_data(
          forecast_length, is_multi_ts=is_multi_ts
      )
      # pipeline initialization
      pipeline = ts_complex_ridge_smoothing_pipeline()
      # pipeline fit and predict
      pipeline.fit(train_data)
      prediction_before = np.ravel(
          np.array(pipeline.predict(test_data).predict)
      )
      # metrics evaluation
      rmse, mae = calculate_metrics(
          np.ravel(test_data.target), prediction_before
      )
  
      # compose pipeline with initial approximation
      obtained_pipeline = compose_pipeline(pipeline, train_data, task)
      # composed pipeline fit and predict
      obtained_pipeline_copy = deepcopy(obtained_pipeline)
      obtained_pipeline.fit_from_scratch(train_data)
      prediction_after = obtained_pipeline.predict(test_data)
      predict_after = np.ravel(np.array(prediction_after.predict))
      # metrics evaluation
      rmse_composing, mae_composing = calculate_metrics(
          np.ravel(test_data.target), predict_after
      )
  
      # tuning composed pipeline
      tuner = (
          TunerBuilder(task)
          .with_tuner(SimultaneousTuner)
          .with_metric(RegressionMetricsEnum.MAE)
          .with_iterations(50)
          .build(train_data)
      )
      obtained_pipeline_copy = tuner.tune(obtained_pipeline_copy)
      obtained_pipeline_copy.print_structure()
      # tuned pipeline fit and predict
      obtained_pipeline_copy.fit_from_scratch(train_data)
      prediction_after_tuning = obtained_pipeline_copy.predict(
          test_data
      )
      predict_after_tuning = np.ravel(
          np.array(prediction_after_tuning.predict)
      )
      # metrics evaluation
      rmse_tuning, mae_tuning = calculate_metrics(
          np.ravel(test_data.target), predict_after_tuning
      )
  
      # visualization of results
      if is_multi_ts:
          history = np.ravel(train_data.target[:, 0])
      else:
          history = np.ravel(train_data.target)
      plt.plot(
          np.ravel(test_data.idx),
          np.ravel(test_data.target),
          label="test",
      )
      plt.plot(np.ravel(train_data.idx), history, label="history")
      plt.plot(
          np.ravel(test_data.idx), prediction_before, label="prediction"
      )
      plt.plot(
          np.ravel(test_data.idx),
          predict_after,
          label="prediction_after_composing",
      )
      plt.plot(
          np.ravel(test_data.idx),
          predict_after_tuning,
          label="prediction_after_tuning",
      )
      plt.xlabel("Time step")
      plt.ylabel("Sea level")
      plt.legend()
      plt.show()
  
      print(f"RMSE: {round(rmse, 3)}")
      print(f"MAE: {round(mae, 3)}")
      print(f"RMSE after composing: {round(rmse_composing, 3)}")
      print(f"MAE after composing: {round(mae_composing, 3)}")
      print(f"RMSE after tuning: {round(rmse_tuning, 3)}")
      print(f"MAE after tuning: {round(mae_tuning, 3)}")
  
file_path: FEDOT/examples/advanced/time_series_forecasting/multi_ts_arctic_forecasting.py
imports: import datetime
  from copy import deepcopy
  import numpy
  from golem.core.optimisers.genetic.gp_params import GPAlgorithmParameters
  from golem.core.optimisers.genetic.operators.mutation import MutationTypesEnum
  from golem.core.tuning.simultaneous import SimultaneousTuner
  from fedot.core.pipelines.pipeline_composer_requirements import PipelineComposerRequirements
  from matplotlib import pyplot
  from sklearn.metrics import mean_squared_error, mean_absolute_error
  from cases.multi_ts_level_forecasting import prepare_data
  from examples.simple.time_series_forecasting.ts_pipelines import ts_complex_ridge_smoothing_pipeline
  from fedot.core.composer.composer_builder import ComposerBuilder
  from fedot.core.composer.gp_composer.specific_operators import parameter_change_mutation
  from fedot.core.pipelines.tuning.tuner_builder import TunerBuilder
  from fedot.core.repository.metrics_repository import RegressionMetricsEnum
label_desc: Use image node_id 4 for calling a global function with example usage: run_multiple_ts_forecasting(forecast_length, is_multi_ts) without return types