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: Infer on the given data according to given in the config infer method,             e.g. ``"predict", "predict_proba", "transform"``
  
  Args:
      *args: list of inputs
  
  Returns:
      predictions, e.g. list of labels, array of probability distribution, sparse array of vectorized samples
docstr_tok: ["Infer","on","the","given","data","according","to","given","in","the","config","infer","method",",","e.g",".","``","``","predict","''",",","``","predict_proba","''",",","``","transform","''","``","Args",":","*","args",":","list","of","inputs","Returns",":","predictions",",","e.g",".","list","of","labels",",","array","of","probability","distribution",",","sparse","array","of","vectorized","samples"]
code: def __call__(self, *args):
      """
          Infer on the given data according to given in the config infer method, \
              e.g. ``"predict", "predict_proba", "transform"``
  
          Args:
              *args: list of inputs
  
          Returns:
              predictions, e.g. list of labels, array of probability distribution, sparse array of vectorized samples
          """
      x_features = self.compose_input_data(args)
  
      try:
          predictions = self.infer_method(x_features)
      except TypeError or ValueError:
          if issparse(x_features):
              log.debug(
                  "Converting input for model {} to dense array".format(
                      self.model_class
                  )
              )
              predictions = self.infer_method(x_features.todense())
          else:
              log.debug(
                  "Converting input for model {} to sparse array".format(
                      self.model_class
                  )
              )
              predictions = self.infer_method(csr_matrix(x_features))
  
      if isinstance(predictions, list):
          #  ``predict_proba`` sometimes returns list of n_outputs (each output corresponds to a label)
          #  but we will return (n_samples, n_labels)
          #  where each value is a probability of a sample to belong with the label
          predictions_ = [
              [predictions[j][i][1] for j in range(len(predictions))]
              for i in range(x_features.shape[0])
          ]
          predictions = np.array(predictions_)
  
      if self.ensure_list_output and len(predictions.shape) == 1:
          predictions = predictions.reshape(-1, 1)
  
      if issparse(predictions):
          return predictions
      else:
          return predictions.tolist()
  
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 3 for calling the SklearnComponent obj's underlying member method code with example usage: obj.__call__() and returns: predictions, predictions