class_docstr: The main class for FEDOT AutoML API.
  
  Alternatively, may be initialized using the class :class:`~fedot.api.builder.FedotBuilder`,
  where all the optional AutoML parameters are documented and separated by meaning.
  
  Args:
      problem: name of the modelling problem to solve.
          .. details:: Possible options:
  
              - ``classification`` -> for classification task
              - ``regression`` -> for regression task
              - ``ts_forecasting`` -> for time series forecasting task
  
      timeout: time for model design (in minutes): ``None`` or ``-1`` means infinite time.
      task_params: additional parameters of the task.
      seed: value for a fixed random seed.
      logging_level: logging levels are the same as in
          `built-in logging library <https://docs.python.org/3/library/logging.html>`_.
  
          .. details:: Possible options:
  
              - ``50`` -> critical
              - ``40`` -> error
              - ``30`` -> warning
              - ``20`` -> info
              - ``10`` -> debug
              - ``0`` -> nonset
  
      safe_mode: if set ``True`` it will cut large datasets to prevent memory overflow and use label encoder
          instead of OneHot encoder if summary cardinality of categorical features is high.
          Default value is ``False``.
  
      n_jobs: num of ``n_jobs`` for parallelization (set to ``-1`` to use all cpu's). Defaults to ``-1``.
  
      composer_tuner_params: Additional optional parameters. See their documentation at the methods of
          :class:`~fedot.api.builder.FedotBuilder`.
class_docstr_tok: ["The","main","class","for","FEDOT","AutoML","API",".","Alternatively",",","may","be","initialized","using","the","class",":","class",":","`","~fedot.api.builder.FedotBuilder","`",",","where","all","the","optional","AutoML","parameters","are","documented","and","separated","by","meaning",".","Args",":","problem",":","name","of","the","modelling","problem","to","solve",".","..","details",":",":","Possible","options",":","-","``","classification","``","-",">","for","classification","task","-","``","regression","``","-",">","for","regression","task","-","``","ts_forecasting","``","-",">","for","time","series","forecasting","task","timeout",":","time","for","model","design","(","in","minutes",")",":","``","None","``","or","``","-1","``","means","infinite","time",".","task_params",":","additional","parameters","of","the","task",".","seed",":","value","for","a","fixed","random","seed",".","logging_level",":","logging","levels","are","the","same","as","in","`","built-in","logging","library","<","https",":","\/\/docs.python.org\/3\/library\/logging.html",">","`","_",".","..","details",":",":","Possible","options",":","-","``","50","``","-",">","critical","-","``","40","``","-",">","error","-","``","30","``","-",">","warning","-","``","20","``","-",">","info","-","``","10","``","-",">","debug","-","``","0","``","-",">","nonset","safe_mode",":","if","set","``","True","``","it","will","cut","large","datasets","to","prevent","memory","overflow","and","use","label","encoder","instead","of","OneHot","encoder","if","summary","cardinality","of","categorical","features","is","high",".","Default","value","is","``","False","``",".","n_jobs",":","num","of","``","n_jobs","``","for","parallelization","(","set","to","``","-1","``","to","use","all","cpu","'s",")",".","Defaults","to","``","-1","``",".","composer_tuner_params",":","Additional","optional","parameters",".","See","their","documentation","at","the","methods","of",":","class",":","`","~fedot.api.builder.FedotBuilder","`","."]
docstr: Forecasts the new values of time series. If horizon is bigger than forecast length of fitted model -
  out-of-sample forecast is applied (not supported for multi-modal data).
  
  Args:
      pre_history: an array with features for pre-history of the forecast.
      horizon: amount of steps to forecast.
      save_predictions: if ``True`` save predictions as csv-file in working directory.
  
  Returns:
      An array with prediction values.
code: def forecast(
      self,
      pre_history: Optional[
          Union[str, Tuple[np.ndarray, np.ndarray], InputData, dict]
      ] = None,
      horizon: Optional[int] = None,
      save_predictions: bool = False,
  ) -> np.ndarray:
      """Forecasts the new values of time series. If horizon is bigger than forecast length of fitted model -
      out-of-sample forecast is applied (not supported for multi-modal data).
  
      Args:
          pre_history: an array with features for pre-history of the forecast.
          horizon: amount of steps to forecast.
          save_predictions: if ``True`` save predictions as csv-file in working directory.
  
      Returns:
          An array with prediction values.
      """
      self._check_forecast_applicable()
  
      forecast_length = self.train_data.task.task_params.forecast_length
      horizon = horizon or forecast_length
      if pre_history is None:
          pre_history = self.train_data
          pre_history.target = None
      self.test_data = self.data_processor.define_data(
          target=self.target, features=pre_history, is_predict=True
      )
      predict = out_of_sample_ts_forecast(
          self.current_pipeline, self.test_data, horizon
      )
      self.prediction = convert_forecast_to_output(
          self.test_data, predict
      )
      self._is_in_sample_prediction = False
      if save_predictions:
          self.save_predict(self.prediction)
      return self.prediction.predict
  
imports: import logging
  from copy import deepcopy
  from typing import Any, List, Optional, Sequence, Tuple, Union
  import numpy
  import pandas
  from golem.core.dag.graph_utils import graph_structure
  from golem.core.log import Log, default_log
  from golem.core.optimisers.opt_history_objects.opt_history import OptHistory
  from golem.core.tuning.simultaneous import SimultaneousTuner
  from golem.utilities.data_structures import ensure_wrapped_in_sequence
  from golem.visualisation.opt_viz_extra import visualise_pareto
  from fedot.api.api_utils.api_composer import ApiComposer
  from fedot.api.api_utils.api_data import ApiDataProcessor
  from fedot.api.api_utils.data_definition import FeaturesType, TargetType
  from fedot.api.api_utils.input_analyser import InputAnalyser
  from fedot.api.api_utils.params import ApiParams
  from fedot.api.api_utils.predefined_model import PredefinedModel
  from fedot.core.constants import DEFAULT_API_TIMEOUT_MINUTES, DEFAULT_TUNING_ITERATIONS_NUMBER
  from fedot.core.data.data import InputData, OutputData
  from fedot.core.data.multi_modal import MultiModalData
  from fedot.core.data.visualisation import plot_biplot, plot_forecast, plot_roc_auc
  from fedot.core.optimisers.objective import PipelineObjectiveEvaluate
  from fedot.core.optimisers.objective.metrics_objective import MetricsObjective
  from fedot.core.pipelines.pipeline import Pipeline
  from fedot.core.pipelines.ts_wrappers import convert_forecast_to_output, out_of_sample_ts_forecast
  from fedot.core.pipelines.tuning.tuner_builder import TunerBuilder
  from fedot.core.repository.metrics_repository import MetricCallable
  from fedot.core.repository.tasks import TaskParams, TaskTypesEnum
  from fedot.core.utils import set_random_seed
  from fedot.explainability.explainer_template import Explainer
  from fedot.explainability.explainers import explain_pipeline
  from fedot.preprocessing.base_preprocessing import BasePreprocessor
  from fedot.remote.remote_evaluator import RemoteEvaluator
  from fedot.utilities.define_metric_by_task import MetricByTask
  from fedot.utilities.memory import MemoryAnalytics
  from fedot.utilities.project_import_export import export_project_to_zip, import_project_from_zip
label_desc: Use image node_id 6 for calling the Fedot obj's underlying member method code with example usage: obj.forecast(pre_history, horizon, save_predictions) and returns: self