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: Fit model on the given data
  
  Args:
      *args: list of x-inputs and, optionally, one y-input (the last one) to fit on.
          Possible input (x0, ..., xK, y) or (x0, ..., xK) '
          where K is the number of input data elements (the length of list ``in`` from config).                 In case of several inputs (K > 1) input features will be stacked.                 For example, one has x0: (n_samples, n_features0), ..., xK: (n_samples, n_featuresK),                 then model will be trained on x: (n_samples, n_features0 + ... + n_featuresK).
  
  Returns:
      None
docstr_tok: ["Fit","model","on","the","given","data","Args",":","*","args",":","list","of","x-inputs","and",",","optionally",",","one","y-input","(","the","last","one",")","to","fit","on",".","Possible","input","(","x0",",","...",",","xK",",","y",")","or","(","x0",",","...",",","xK",")","'","where","K","is","the","number","of","input","data","elements","(","the","length","of","list","``","in","``","from","config",")",".","In","case","of","several","inputs","(","K",">","1",")","input","features","will","be","stacked",".","For","example",",","one","has","x0",":","(","n_samples",",","n_features0",")",",","...",",","xK",":","(","n_samples",",","n_featuresK",")",",","then","model","will","be","trained","on","x",":","(","n_samples",",","n_features0","+","...","+","n_featuresK",")",".","Returns",":","None"]
code: def fit(self, *args) -> None:
      """
          Fit model on the given data
  
          Args:
              *args: list of x-inputs and, optionally, one y-input (the last one) to fit on.
                  Possible input (x0, ..., xK, y) or (x0, ..., xK) '
                  where K is the number of input data elements (the length of list ``in`` from config). \
                  In case of several inputs (K > 1) input features will be stacked. \
                  For example, one has x0: (n_samples, n_features0), ..., xK: (n_samples, n_featuresK), \
                  then model will be trained on x: (n_samples, n_features0 + ... + n_featuresK).
  
          Returns:
              None
          """
      n_inputs = (
          len(self.pipe_params["in"])
          if isinstance(self.pipe_params["in"], list)
          else 1
      )
      x_features = self.compose_input_data(args[:n_inputs])
      if len(args) > n_inputs:
          y_ = np.squeeze(np.array(args[-1]))
      else:
          y_ = None
  
      try:
          log.info("Fitting model {}".format(self.model_class))
          self.model.fit(x_features, y_)
      except TypeError or ValueError:
          if issparse(x_features):
              log.info(
                  "Converting input for model {} to dense array".format(
                      self.model_class
                  )
              )
              self.model.fit(x_features.todense(), y_)
          else:
              log.info(
                  "Converting input for model {} to sparse array".format(
                      self.model_class
                  )
              )
              self.model.fit(csr_matrix(x_features), y_)
  
      return
  
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 2 for calling the SklearnComponent obj's underlying member method code with example usage: obj.fit() without return types