code: def get_algorithm(cls, params):
      alg_type = params.get("model_type", "Xgboost")
      ml_task = params.get("ml_task", BINARY_CLASSIFICATION)
  
      try:
          Algorithm = AlgorithmsRegistry.get_algorithm_class(
              ml_task, alg_type
          )
          return Algorithm(params)
      except Exception as e:
          raise AutoMLException(f"Cannot get algorithm class. {str(e)}")
  
imports: import logging
  from supervised.algorithms.registry import BINARY_CLASSIFICATION, AlgorithmsRegistry
  from supervised.exceptions import AutoMLException
label_desc: Use image node_id 1 for calling the AlgorithmFactory obj's underlying member method code with example usage: obj.get_algorithm(cls, params) and returns: Algorithm