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: Initialize component with given parameters
docstr_tok: ["Initialize","component","with","given","parameters"]
code: def __init__(
      self,
      model_class: str,
      save_path: Union[str, Path] = None,
      load_path: Union[str, Path] = None,
      infer_method: str = "predict",
      ensure_list_output: bool = False,
      **kwargs,
  ) -> None:
      """
      Initialize component with given parameters
      """
  
      super().__init__(
          save_path=save_path, load_path=load_path, **kwargs
      )
      self.model_class = model_class
      self.model_params = kwargs
      self.model = None
      self.ensure_list_output = ensure_list_output
      self.pipe_params = {}
      for required in ["in", "out", "fit_on", "main", "name"]:
          self.pipe_params[required] = self.model_params.pop(
              required, None
          )
  
      self.load()
      self.infer_method = getattr(self.model, infer_method)
  
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 1 to create a new SklearnComponent object from inherited base classes: Estimator with example: obj = SklearnComponent(model_class, save_path, load_path, infer_method, ensure_list_output)