class_docstr: Igel is the base model to use the fit, evaluate and predict functions of the sklearn library
class_docstr_tok: ["Igel","is","the","base","model","to","use","the","fit",",","evaluate","and","predict","functions","of","the","sklearn","library"]
docstr: fetch a model depending on the provided type and algorithm by the user and return it
  @return: class of the chosen model
docstr_tok: ["fetch","a","model","depending","on","the","provided","type","and","algorithm","by","the","user","and","return","it","@","return",":","class","of","the","chosen","model"]
code: def _create_model(self, **kwargs):
      """
      fetch a model depending on the provided type and algorithm by the user and return it
      @return: class of the chosen model
      """
      model_type: str = self.model_props.get("type")
      model_algorithm: str = self.model_props.get("algorithm")
      use_cv = self.model_props.get("use_cv_estimator", None)
  
      model_args = None
      if not model_type or not model_algorithm:
          raise Exception(f"model_type and algorithm cannot be None")
      algorithms: dict = models_dict.get(
          model_type
      )  # extract all algorithms as a dictionary
      model = algorithms.get(
          model_algorithm
      )  # extract model class depending on the algorithm
      logger.info(
          f"Solving a {model_type} problem using ===> {model_algorithm}"
      )
      if not model:
          raise Exception("Model not found in the algorithms list")
      else:
          model_props_args = self.model_props.get("arguments", None)
          if model_props_args and type(model_props_args) == dict:
              model_args = model_props_args
          elif (
              not model_props_args
              or model_props_args.lower() == "default"
          ):
              model_args = None
  
          if use_cv:
              model_class = model.get("cv_class", None)
              if model_class:
                  logger.info(
                      f"cross validation estimator detected. "
                      f"Switch to the CV version of the {model_algorithm} algorithm"
                  )
              else:
                  logger.info(
                      f"No CV class found for the {model_algorithm} algorithm"
                  )
          else:
              model_class = model.get("class")
          logger.info(
              f"model arguments: \n"
              f"{self.model_props.get('arguments')}"
          )
          model = (
              model_class(**kwargs)
              if not model_args
              else model_class(**model_args)
          )
          return model, model_args
  
imports: import json
  import logging
  import os
  import warnings
  import joblib
  import numpy
  import pandas
  from sklearn.model_selection import cross_validate, train_test_split
  from sklearn.multioutput import MultiOutputClassifier, MultiOutputRegressor
  from skl2onnx import convert_sklearn
  from skl2onnx.common.data_types import FloatTensorType
label_desc: Use image node_id 2 for calling the Igel obj's underlying member method code with example usage: obj._create_model() and returns: model,  model_args