code: def run_classification(
      train_data, test_data, timeout: float = 5, visualize=False
  ):
      auto_model = Fedot(
          problem="classification",
          timeout=timeout,
          n_jobs=8,
          early_stopping_iterations=None,
      )
      auto_model.fit(
          features=train_data.features, target=train_data.target
      )
      prediction = auto_model.predict(features=test_data.features)
      metrics = auto_model.get_metrics(target=test_data.target)
      print(metrics)
      if visualize:
          auto_model.current_pipeline.show()
          auto_model.plot_prediction()
      return prediction
  
file_path: FEDOT/cases/kc2_sourcecode_defects_classification.py
imports: from os.path import join
  from fedot import Fedot
  from fedot.core.data.data import InputData
  from fedot.core.data.data_split import train_test_data_setup
  from fedot.core.repository.tasks import TaskTypesEnum, Task
  from fedot.core.utils import fedot_project_root
label_desc: Use image node_id 2 for calling a global function with example usage: run_classification(train_data, test_data, timeout, visualize) and returns: prediction