code: def get_model_from_name(
      model_name, training_params=None, is_hp_search=False
  ):
      global keras_imported
  
      # For Keras
      epochs = 1000
      # if os.environ.get('is_test_suite', 0) == 'True' and model_name[:12] == 'DeepLearning':
      #     print('Heard that this is the test suite. Limiting number of epochs, which will increase training speed dramatically at the expense of model accuracy')
      #     epochs = 100
  
      all_model_params = {
          "LogisticRegression": {},
          "RandomForestClassifier": {"n_jobs": -2, "n_estimators": 30},
          "ExtraTreesClassifier": {"n_jobs": -1},
          "AdaBoostClassifier": {},
          "SGDClassifier": {"n_jobs": -1},
          "Perceptron": {"n_jobs": -1},
          "LinearSVC": {"dual": False},
          "LinearRegression": {"n_jobs": -2},
          "RandomForestRegressor": {"n_jobs": -2, "n_estimators": 30},
          "LinearSVR": {
              "dual": False,
              "loss": "squared_epsilon_insensitive",
          },
          "ExtraTreesRegressor": {"n_jobs": -1},
          "MiniBatchKMeans": {"n_clusters": 8},
          "GradientBoostingRegressor": {
              "presort": False,
              "learning_rate": 0.1,
              "warm_start": True,
          },
          "GradientBoostingClassifier": {
              "presort": False,
              "learning_rate": 0.1,
              "warm_start": True,
          },
          "SGDRegressor": {"shuffle": False},
          "PassiveAggressiveRegressor": {"shuffle": False},
          "AdaBoostRegressor": {},
          "LGBMRegressor": {
              "n_estimators": 2000,
              "learning_rate": 0.15,
              "num_leaves": 8,
              "lambda_l2": 0.001,
              "histogram_pool_size": 16384,
          },
          "LGBMClassifier": {
              "n_estimators": 2000,
              "learning_rate": 0.15,
              "num_leaves": 8,
              "lambda_l2": 0.001,
              "histogram_pool_size": 16384,
          },
          "DeepLearningRegressor": {
              "epochs": epochs,
              "batch_size": 50,
              "verbose": 2,
          },
          "DeepLearningClassifier": {
              "epochs": epochs,
              "batch_size": 50,
              "verbose": 2,
          },
          "CatBoostRegressor": {},
          "CatBoostClassifier": {},
      }
  
      # if os.environ.get('is_test_suite', 0) == 'True':
      #     all_model_params
  
      model_params = all_model_params.get(model_name, None)
      if model_params is None:
          model_params = {}
  
      if is_hp_search == True:
          if model_name[:12] == "DeepLearning":
              model_params["epochs"] = 50
          if model_name[:4] == "LGBM":
              model_params["n_estimators"] = 500
  
      if training_params is not None:
          print(
              "Now using the model training_params that you passed in:"
          )
          print(training_params)
          # Overwrite our stock params with what the user passes in (i.e., if the user wants 10,000 trees, we will let them do it)
          model_params.update(training_params)
          print(
              "After overwriting our defaults with your values, here are the final params that will be used to initialize the model:"
          )
          print(model_params)
  
      model_map = {
          # Classifiers
          "LogisticRegression": LogisticRegression(),
          "RandomForestClassifier": RandomForestClassifier(),
          "RidgeClassifier": RidgeClassifier(),
          "GradientBoostingClassifier": GradientBoostingClassifier(),
          "ExtraTreesClassifier": ExtraTreesClassifier(),
          "AdaBoostClassifier": AdaBoostClassifier(),
          "LinearSVC": LinearSVC(),
          # Regressors
          "LinearRegression": LinearRegression(),
          "RandomForestRegressor": RandomForestRegressor(),
          "Ridge": Ridge(),
          "LinearSVR": LinearSVR(),
          "ExtraTreesRegressor": ExtraTreesRegressor(),
          "AdaBoostRegressor": AdaBoostRegressor(),
          "RANSACRegressor": RANSACRegressor(),
          "GradientBoostingRegressor": GradientBoostingRegressor(),
          "Lasso": Lasso(),
          "ElasticNet": ElasticNet(),
          "LassoLars": LassoLars(),
          "OrthogonalMatchingPursuit": OrthogonalMatchingPursuit(),
          "BayesianRidge": BayesianRidge(),
          "ARDRegression": ARDRegression(),
          # Clustering
          "MiniBatchKMeans": MiniBatchKMeans(),
      }
  
      try:
          model_map["SGDClassifier"] = SGDClassifier(
              max_iter=1000, tol=0.001
          )
          model_map["Perceptron"] = Perceptron(max_iter=1000, tol=0.001)
          model_map[
              "PassiveAggressiveClassifier"
          ] = PassiveAggressiveClassifier(max_iter=1000, tol=0.001)
          model_map["SGDRegressor"] = SGDRegressor(
              max_iter=1000, tol=0.001
          )
          model_map[
              "PassiveAggressiveRegressor"
          ] = PassiveAggressiveRegressor(max_iter=1000, tol=0.001)
      except TypeError:
          model_map["SGDClassifier"] = SGDClassifier()
          model_map["Perceptron"] = Perceptron()
          model_map[
              "PassiveAggressiveClassifier"
          ] = PassiveAggressiveClassifier()
          model_map["SGDRegressor"] = SGDRegressor()
          model_map[
              "PassiveAggressiveRegressor"
          ] = PassiveAggressiveRegressor()
  
      if xgb_installed:
          model_map["XGBClassifier"] = XGBClassifier()
          model_map["XGBRegressor"] = XGBRegressor()
  
      if lgb_installed:
          model_map["LGBMRegressor"] = LGBMRegressor()
          model_map["LGBMClassifier"] = LGBMClassifier()
  
      if catboost_installed:
          model_map["CatBoostRegressor"] = CatBoostRegressor(
              calc_feature_importance=True
          )
          model_map["CatBoostClassifier"] = CatBoostClassifier(
              calc_feature_importance=True
          )
  
      if model_name[:12] == "DeepLearning":
          if keras_imported == False:
              # Suppress some level of logs if TF is installed (but allow it to not be installed, and use Theano instead)
              try:
                  os.environ["TF_CPP_MIN_VLOG_LEVEL"] = "3"
                  os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
                  from tensorflow import logging
  
                  logging.set_verbosity(logging.INFO)
              except:
                  pass
  
              global maxnorm
              global Dense, Dropout
              global LeakyReLU, PReLU, ThresholdedReLU, ELU
              global Sequential
              global keras_load_model
              global regularizers, optimizers
              global Activation
              global KerasRegressor, KerasClassifier
  
              from keras.constraints import maxnorm
              from keras.layers import Activation, Dense, Dropout
              from keras.layers.advanced_activations import (
                  LeakyReLU,
                  PReLU,
                  ThresholdedReLU,
                  ELU,
              )
              from keras.models import Sequential
              from keras.models import load_model as keras_load_model
              from keras import regularizers, optimizers
              from keras.wrappers.scikit_learn import (
                  KerasRegressor,
                  KerasClassifier,
              )
  
              keras_imported = True
  
          model_map["DeepLearningClassifier"] = KerasClassifier(
              build_fn=make_deep_learning_classifier
          )
          model_map["DeepLearningRegressor"] = KerasRegressor(
              build_fn=make_deep_learning_model
          )
  
      try:
          model_without_params = model_map[model_name]
      except KeyError as e:
          print(
              "It appears you are trying to use a library that is not available when we try to import it, or using a value for model_names that we do not recognize"
          )
          raise (e)
  
      if os.environ.get("is_test_suite", False) == "True":
          if "n_jobs" in model_params:
              model_params["n_jobs"] = 1
      model_with_params = model_without_params.set_params(
          **model_params
      )
  
      return model_with_params
  
file_path: auto_ml/auto_ml/utils_models.py
imports: import dill
  import os
  import random
  import sys
  from auto_ml import utils
  from auto_ml import utils_categorical_ensembling
  from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor, ExtraTreesRegressor, AdaBoostRegressor, GradientBoostingRegressor, GradientBoostingClassifier, ExtraTreesClassifier, AdaBoostClassifier
  from sklearn.linear_model import RANSACRegressor, LinearRegression, Ridge, Lasso, ElasticNet, LassoLars, OrthogonalMatchingPursuit, BayesianRidge, ARDRegression, SGDRegressor, PassiveAggressiveRegressor, LogisticRegression, RidgeClassifier, SGDClassifier, Perceptron, PassiveAggressiveClassifier
  from sklearn.svm import LinearSVC, LinearSVR
  from sklearn.cluster import MiniBatchKMeans
label_desc: Use image node_id 1 for calling a global function with example usage: get_model_from_name(model_name, training_params, is_hp_search) and returns: model_with_params