class_docstr: An alternative FEDOT API version with optional attributes being documented
  and separated into groups by meaning.
  Each of the groups has corresponding setter method, named starting with :obj:`setup_*`.
  Use these methods to set corresponding API attributes:
  
  * :meth:`~FedotBuilder.setup_composition` -> general AutoML parameters
  
  * :meth:`~FedotBuilder.setup_parallelization` -> parameters of computational parallelization by CPU jobs
  
  * :meth:`~FedotBuilder.setup_output` -> parameters of outputs: logging, cache directories, etc.
  
  * :meth:`~FedotBuilder.setup_evolution` -> parameters of ML pipelines evolutionary optimization
  
  * :meth:`~FedotBuilder.setup_pipeline_structure` -> constrains on ML pipeline structure
  
  * :meth:`~FedotBuilder.setup_pipeline_evaluation` -> parameters of ML pipelines quality evaluation
  
  * :meth:`~FedotBuilder.setup_data_preprocessing` -> parameters of input data preprocessing
  
  After all demanded attributes are set, use :meth:`~FedotBuilder.build` to get a parametrized instance of
  :class:`~fedot.api.main.Fedot`.
  
  Examples:
      Example 1:
  
      .. literalinclude:: ../../../examples/simple/api_builder/classification_with_api_builder.py
  
      Example 2:
  
      .. literalinclude:: ../../../examples/simple/api_builder/multiple_ts_forecasting_tasks.py
  
  Args:
      problem: name of a modelling problem to solve.
  
          .. details:: Possible options:
  
              - ``classification`` -> for classification task
              - ``regression`` -> for regression task
              - ``ts_forecasting`` -> for time series forecasting task
class_docstr_tok: ["An","alternative","FEDOT","API","version","with","optional","attributes","being","documented","and","separated","into","groups","by","meaning",".","Each","of","the","groups","has","corresponding","setter","method",",","named","starting","with",":","obj",":","`","setup_","*","`",".","Use","these","methods","to","set","corresponding","API","attributes",":","*",":","meth",":","`","~FedotBuilder.setup_composition","`","-",">","general","AutoML","parameters","*",":","meth",":","`","~FedotBuilder.setup_parallelization","`","-",">","parameters","of","computational","parallelization","by","CPU","jobs","*",":","meth",":","`","~FedotBuilder.setup_output","`","-",">","parameters","of","outputs",":","logging",",","cache","directories",",","etc",".","*",":","meth",":","`","~FedotBuilder.setup_evolution","`","-",">","parameters","of","ML","pipelines","evolutionary","optimization","*",":","meth",":","`","~FedotBuilder.setup_pipeline_structure","`","-",">","constrains","on","ML","pipeline","structure","*",":","meth",":","`","~FedotBuilder.setup_pipeline_evaluation","`","-",">","parameters","of","ML","pipelines","quality","evaluation","*",":","meth",":","`","~FedotBuilder.setup_data_preprocessing","`","-",">","parameters","of","input","data","preprocessing","After","all","demanded","attributes","are","set",",","use",":","meth",":","`","~FedotBuilder.build","`","to","get","a","parametrized","instance","of",":","class",":","`","~fedot.api.main.Fedot","`",".","Examples",":","Example","1",":","..","literalinclude",":",":","..","\/","..","\/","..","\/examples\/simple\/api_builder\/classification_with_api_builder.py","Example","2",":","..","literalinclude",":",":","..","\/","..","\/","..","\/examples\/simple\/api_builder\/multiple_ts_forecasting_tasks.py","Args",":","problem",":","name","of","a","modelling","problem","to","solve",".","..","details",":",":","Possible","options",":","-","``","classification","``","-",">","for","classification","task","-","``","regression","``","-",">","for","regression","task","-","``","ts_forecasting","``","-",">","for","time","series","forecasting","task"]
docstr: Sets parameters of ML pipelines evolutionary optimization.
  
  Args:
      initial_assumption: initial assumption(s) for composer.
          Can be either a single :class:`Pipeline` or sequence of ones. Default values are task-specific and
          selected by the method
          :meth:`~fedot.api.api_utils.assumptions.task_assumptions.TaskAssumptions.for_task`.
  
      early_stopping_iterations: composer will stop after ``n`` generation without improving
  
      num_of_generations: number of evolutionary generations for composer. Defaults to ``None`` - no limit.
  
      early_stopping_iterations: composer will stop after ``n`` generation without improving.
  
      early_stopping_timeout: stagnation timeout in minutes: composer will stop after ``n`` minutes
          without improving. Defaults to ``10``.
  
      pop_size: size of population (generation) during composing. Defaults to ``20``.
  
      keep_n_best: number of the best individuals in generation that survive during the evolution.
           Defaults to ``1``.
  
      genetic_scheme: name of the genetic scheme. Defaults to ``steady_state``.
  
      use_pipelines_cache: indicates whether to use pipeline structures caching. Defaults to ``True``.
  
      optimizer: inherit from :class:`golem.core.optimisers.optimizer.GraphOptimizer`
          to specify a custom optimizer.
          Default optimizer is :class:`golem.core.optimisers.genetic.gp_optimizer.EvoGraphOptimizer`.
          See the :doc:`example </advanced/external_optimizer>`.
  
  Returns:
      :class:`FedotBuilder` instance.
docstr_tok: ["Sets","parameters","of","ML","pipelines","evolutionary","optimization",".","Args",":","initial_assumption",":","initial","assumption","(","s",")","for","composer",".","Can","be","either","a","single",":","class",":","`","Pipeline","`","or","sequence","of","ones",".","Default","values","are","task-specific","and","selected","by","the","method",":","meth",":","`","~fedot.api.api_utils.assumptions.task_assumptions.TaskAssumptions.for_task","`",".","early_stopping_iterations",":","composer","will","stop","after","``","n","``","generation","without","improving","num_of_generations",":","number","of","evolutionary","generations","for","composer",".","Defaults","to","``","None","``","-","no","limit",".","early_stopping_iterations",":","composer","will","stop","after","``","n","``","generation","without","improving",".","early_stopping_timeout",":","stagnation","timeout","in","minutes",":","composer","will","stop","after","``","n","``","minutes","without","improving",".","Defaults","to","``","10","``",".","pop_size",":","size","of","population","(","generation",")","during","composing",".","Defaults","to","``","20","``",".","keep_n_best",":","number","of","the","best","individuals","in","generation","that","survive","during","the","evolution",".","Defaults","to","``","1","``",".","genetic_scheme",":","name","of","the","genetic","scheme",".","Defaults","to","``","steady_state","``",".","use_pipelines_cache",":","indicates","whether","to","use","pipeline","structures","caching",".","Defaults","to","``","True","``",".","optimizer",":","inherit","from",":","class",":","`","golem.core.optimisers.optimizer.GraphOptimizer","`","to","specify","a","custom","optimizer",".","Default","optimizer","is",":","class",":","`","golem.core.optimisers.genetic.gp_optimizer.EvoGraphOptimizer","`",".","See","the",":","doc",":","`","example","<","\/advanced\/external_optimizer",">","`",".","Returns",":",":","class",":","`","FedotBuilder","`","instance","."]
code: def setup_evolution(
      self,
      initial_assumption: Union[
          Pipeline, List[Pipeline]
      ] = DEFAULT_VALUE,
      num_of_generations: Optional[int] = DEFAULT_VALUE,
      early_stopping_iterations: int = DEFAULT_VALUE,
      early_stopping_timeout: int = DEFAULT_VALUE,
      pop_size: int = DEFAULT_VALUE,
      keep_n_best: int = DEFAULT_VALUE,
      genetic_scheme: str = DEFAULT_VALUE,
      use_pipelines_cache: bool = DEFAULT_VALUE,
      optimizer: Optional[Type[GraphOptimizer]] = DEFAULT_VALUE,
  ) -> FedotBuilder:
      """Sets parameters of ML pipelines evolutionary optimization.
  
      Args:
          initial_assumption: initial assumption(s) for composer.
              Can be either a single :class:`Pipeline` or sequence of ones. Default values are task-specific and
              selected by the method
              :meth:`~fedot.api.api_utils.assumptions.task_assumptions.TaskAssumptions.for_task`.
  
          early_stopping_iterations: composer will stop after ``n`` generation without improving
  
          num_of_generations: number of evolutionary generations for composer. Defaults to ``None`` - no limit.
  
          early_stopping_iterations: composer will stop after ``n`` generation without improving.
  
          early_stopping_timeout: stagnation timeout in minutes: composer will stop after ``n`` minutes
              without improving. Defaults to ``10``.
  
          pop_size: size of population (generation) during composing. Defaults to ``20``.
  
          keep_n_best: number of the best individuals in generation that survive during the evolution.
               Defaults to ``1``.
  
          genetic_scheme: name of the genetic scheme. Defaults to ``steady_state``.
  
          use_pipelines_cache: indicates whether to use pipeline structures caching. Defaults to ``True``.
  
          optimizer: inherit from :class:`golem.core.optimisers.optimizer.GraphOptimizer`
              to specify a custom optimizer.
              Default optimizer is :class:`golem.core.optimisers.genetic.gp_optimizer.EvoGraphOptimizer`.
              See the :doc:`example </advanced/external_optimizer>`.
  
      Returns:
          :class:`FedotBuilder` instance.
      """
      self.__update_params(
          initial_assumption=initial_assumption,
          num_of_generations=num_of_generations,
          early_stopping_iterations=early_stopping_iterations,
          early_stopping_timeout=early_stopping_timeout,
          pop_size=pop_size,
          keep_n_best=keep_n_best,
          genetic_scheme=genetic_scheme,
          use_pipelines_cache=use_pipelines_cache,
          optimizer=optimizer,
      )
      return self
  
imports: from __future__ import annotations
  from typing import Any, Dict, List, Optional, Sequence, Type, Union
  from golem.core.optimisers.optimizer import GraphOptimizer
  from fedot.api.main import Fedot
  from fedot.core.pipelines.pipeline import Pipeline
  from fedot.core.repository.metrics_repository import MetricIDType
  from fedot.core.repository.tasks import TaskParams
label_desc: Use image node_id 6 for calling the FedotBuilder obj's underlying member method code with example usage: obj.setup_evolution(initial_assumption, num_of_generations, early_stopping_iterations, early_stopping_timeout, pop_size, keep_n_best, genetic_scheme, use_pipelines_cache, optimizer) and returns: self