class_docstr: Class for checking types in input data. Also perform conversion for columns with types conflicts
class_docstr_tok: ["Class","for","checking","types","in","input","data",".","Also","perform","conversion","for","columns","with","types","conflicts"]
docstr: Convert target columns into one type based on column proportions of object and task 
docstr_tok: ["Convert","target","columns","into","one","type","based","on","column","proportions","of","object","and","task"]
code: def _convert_target_into_one_type(
      self, column_info: pd.Series, target: np.ndarray, task: Task
  ) -> Tuple[np.ndarray, str]:
      """Convert target columns into one type based on column proportions of object and task"""
      if task.task_type is TaskTypesEnum.classification:
          # For classification labels are string if at least one element is a string
          suggested_type = str
      else:
          suggested_type = _obtain_new_column_type(column_info)
      self.target_converted_columns[column_info.name] = TYPE_TO_ID[
          suggested_type
      ]
  
      mixed_column = target[:, column_info.name]
      try:
          target[:, column_info.name] = mixed_column.astype(
              suggested_type
          )
      except ValueError:
          # Cannot convert string objects into int or float (for example 'a' into int)
          converted_column = pd.to_numeric(
              mixed_column, errors="coerce"
          )
  
          prefix = (
              f"Target column with index {column_info.name} contains "
              f"the following data types: {column_info[_TYPES]}."
          )
          log_message = f"{prefix} String cannot be converted into {suggested_type}. Set unconverted values to NaN."
          self.log.debug(log_message)
          self.target_converting_has_errors = True
          target[:, column_info.name] = converted_column
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  from typing import TYPE_CHECKING, Dict, List, Optional, Tuple
  import numpy
  import pandas
  from golem.core.log import LoggerAdapter, default_log
  from fedot.core.repository.tasks import Task, TaskTypesEnum
label_desc: Use image node_id 12 for calling the TableTypesCorrector obj's underlying member method code with example usage: obj._convert_target_into_one_type(column_info, target, task) without return types