docstr: Method fit model on a dataset
  
  :param train_data: data to train the model
docstr_tok: ["Method","fit","model","on","a","dataset",":","param","train_data",":","data","to","train","the","model"]
code: def fit(self, train_data):
      """Method fit model on a dataset
  
      :param train_data: data to train the model
      """
  
      # TODO make case for multiclass multioutput task
      # check for multioutput target
      if len(train_data.target.shape) < 2:
          self.classes = np.unique(train_data.target)
      else:
          self.classes = np.arange(train_data.target.shape[1])
  
      self.model = cnn_model_dict[self.params.get("architecture_type")](
          input_shape=train_data.features.shape[1:4],
          num_classes=len(self.classes),
      )
  
      self.model = fit_cnn(
          train_data=train_data,
          model=self.model,
          epochs=self.params.get("epochs"),
          batch_size=self.params.get("batch_size"),
          optimizer_params=self.params.get("optimizer_parameters"),
          logger=self.params.get("log"),
      )
      return self.model
  
imports: import logging
  import os
  from typing import Optional
  import numpy
  from golem.utilities.requirements_notificator import warn_requirement
  from fedot.core.operations.operation_parameters import OperationParameters
  from fedot.core.data.data import InputData, OutputData
  from golem.core.log import LoggerAdapter, default_log
  from fedot.core.operations.evaluation.operation_implementations.implementation_interfaces import ModelImplementation
  from sklearn import preprocessing
label_desc: Use image node_id 2 for calling the FedotCNNImplementation obj's underlying member method code with example usage: obj.fit(train_data) and returns: self