docstr: Predict method for classification task for predict stage
  
  :param trained_operation: model object
  :param predict_data: data used for prediction
  :return: prediction target
docstr_tok: ["Predict","method","for","classification","task","for","predict","stage",":","param","trained_operation",":","model","object",":","param","predict_data",":","data","used","for","prediction",":","return",":","prediction","target"]
code: def predict(
      self, trained_operation, predict_data: InputData
  ) -> OutputData:
      """
      Predict method for classification task for predict stage
  
      :param trained_operation: model object
      :param predict_data: data used for prediction
      :return: prediction target
      """
      n_classes = len(trained_operation.classes_)
      if self.output_mode == "labels":
          prediction = trained_operation.predict(predict_data)
      elif self.output_mode in ["probs", "full_probs", "default"]:
          prediction = trained_operation.predict_proba(predict_data)
          if n_classes < 2:
              raise ValueError(
                  "Data set contain only 1 target class. Please reformat your data."
              )
          elif (
              n_classes == 2
              and self.output_mode != "full_probs"
              and len(prediction.shape) > 1
          ):
              prediction = prediction[:, 1]
      else:
          raise ValueError(
              f"Output model {self.output_mode} is not supported"
          )
  
      # Convert prediction to output (if it is required)
      converted = self._convert_to_output(prediction, predict_data)
      return converted
  
imports: import warnings
  from typing import Optional
  from fedot.core.data.data import InputData, OutputData
  from fedot.core.operations.evaluation.evaluation_interfaces import EvaluationStrategy, SkLearnEvaluationStrategy
  from fedot.core.operations.evaluation.operation_implementations.data_operations.decompose import DecomposerClassImplementation
  from fedot.core.operations.evaluation.operation_implementations.data_operations.sklearn_filters import IsolationForestClassImplementation
  from fedot.core.operations.evaluation.operation_implementations.data_operations.sklearn_imbalanced_class import ResampleImplementation
  from fedot.core.operations.evaluation.operation_implementations.data_operations.sklearn_selectors import LinearClassFSImplementation, NonLinearClassFSImplementation
  from fedot.core.operations.evaluation.operation_implementations.models.discriminant_analysis import LDAImplementation, QDAImplementation
  from fedot.core.operations.evaluation.operation_implementations.models.keras import FedotCNNImplementation
  from fedot.core.operations.evaluation.operation_implementations.models.knn import FedotKnnClassImplementation
  from fedot.core.operations.evaluation.operation_implementations.models.svc import FedotSVCImplementation
  from fedot.core.operations.operation_parameters import OperationParameters
  from fedot.utilities.random import ImplementationRandomStateHandler
label_desc: Use image node_id 3 for calling the FedotClassificationStrategy obj's underlying member method code with example usage: obj.predict(trained_operation, predict_data) and returns: converted