class_docstr: Class implements wrapper for sklearn components for feature extraction,
  feature selection, classification, regression etc.
  
  Args:
      model_class: string with full name of sklearn model to use, e.g. ``sklearn.linear_model:LogisticRegression``
      save_path: save path for model, e.g. full name ``model_path/model.pkl``             or prefix ``model_path/model`` (still model will be saved to ``model_path/model.pkl``)
      load_path: load path for model, e.g. full name ``model_path/model.pkl``             or prefix ``model_path/model`` (still model will be loaded from ``model_path/model.pkl``)
      infer_method: string name of class method to use for infering model,             e.g. ``predict``, ``predict_proba``, ``predict_log_proba``, ``transform``
      ensure_list_output: whether to ensure that output for each sample is iterable (but not string)
      kwargs: dictionary with parameters for the sklearn model
  
  Attributes:
      model: sklearn model instance
      model_class: string with full name of sklearn model to use, e.g. ``sklearn.linear_model:LogisticRegression``
      model_params: dictionary with parameters for the sklearn model without pipe parameters
      pipe_params: dictionary with parameters for pipe: ``in``, ``out``, ``fit_on``, ``main``, ``name``
      save_path: save path for model, e.g. full name ``model_path/model.pkl``             or prefix ``model_path/model`` (still model will be saved to ``model_path/model.pkl``)
      load_path: load path for model, e.g. full name ``model_path/model.pkl``             or prefix ``model_path/model`` (still model will be loaded from ``model_path/model.pkl``)
      infer_method: string name of class method to use for infering model,             e.g. ``predict``, ``predict_proba``, ``predict_log_proba``, ``transform``
      ensure_list_output: whether to ensure that output for each sample is iterable (but not string)
docstr: Stack given list of different types of inputs to the one matrix. If one of the inputs is a sparse matrix,             then output will be also a sparse matrix
  
  Args:
      x: list of data elements
  
  Returns:
      sparse or dense array of stacked data
docstr_tok: ["Stack","given","list","of","different","types","of","inputs","to","the","one","matrix",".","If","one","of","the","inputs","is","a","sparse","matrix",",","then","output","will","be","also","a","sparse","matrix","Args",":","x",":","list","of","data","elements","Returns",":","sparse","or","dense","array","of","stacked","data"]
code: def compose_input_data(
      x: List[
          Union[
              Tuple[Union[np.ndarray, list, spmatrix, str]],
              List[Union[np.ndarray, list, spmatrix, str]],
              np.ndarray,
              spmatrix,
          ]
      ]
  ) -> Union[spmatrix, np.ndarray]:
      """
          Stack given list of different types of inputs to the one matrix. If one of the inputs is a sparse matrix, \
              then output will be also a sparse matrix
  
          Args:
              x: list of data elements
  
          Returns:
              sparse or dense array of stacked data
          """
      x_features = []
      for i in range(len(x)):
          if (
              isinstance(x[i], tuple)
              or isinstance(x[i], list)
              or isinstance(x[i], np.ndarray)
              and len(x[i])
          ) or (issparse(x[i]) and x[i].shape[0]):
              if issparse(x[i][0]):
                  x_features.append(vstack(list(x[i])))
              elif isinstance(x[i][0], np.ndarray) or isinstance(
                  x[i][0], list
              ):
                  x_features.append(np.vstack(list(x[i])))
              elif isinstance(x[i][0], str):
                  x_features.append(np.array(x[i]))
              else:
                  raise ConfigError(
                      "Not implemented this type of vectors"
                  )
          else:
              raise ConfigError("Input vectors cannot be empty")
  
      sparse = False
      for inp in x_features:
          if issparse(inp):
              sparse = True
      if sparse:
          x_features = hstack(list(x_features))
      else:
          x_features = np.hstack(list(x_features))
  
      return x_features
  
imports: import inspect
  import pickle
  from logging import getLogger
  from pathlib import Path
  from typing import List, Tuple, Union, Callable
  import numpy
  from scipy.sparse import issparse, csr_matrix
  from scipy.sparse import spmatrix
  from scipy.sparse import vstack, hstack
  from deeppavlov.core.common.errors import ConfigError
  from deeppavlov.core.common.registry import register, cls_from_str
  from deeppavlov.core.models.estimator import Estimator
label_desc: Use image node_id 7 for calling the SklearnComponent obj's underlying member method code with example usage: obj.compose_input_data(x) and returns: x_features