code: def build_model(algo_params):
      if algo_params["training_frame"] is None:
          raise ValueError("Missing training_frame")
      x = algo_params.pop("X")
      y = algo_params.pop("y", None)
      training_frame = algo_params.pop("training_frame")
      validation_frame = algo_params.pop("validation_frame", None)
      algo = algo_params.pop("algo")
      is_auto_encoder = (
          algo_params is not None
          and "autoencoder" in algo_params
          and algo_params["autoencoder"] is not None
      )
      is_unsupervised = (
          is_auto_encoder or algo == "pca" or algo == "kmeans"
      )
      if is_auto_encoder and y is not None:
          raise ValueError("y should not be specified for autoencoder.")
      if not is_unsupervised and y is None:
          raise ValueError("Missing response")
      return _model_build(
          x, y, training_frame, validation_frame, algo, algo_params
      )
  
file_path: h2o-3/h2o-py/h2o/model/model_builder.py
imports: from h2o.utils.compatibility import *
  import h2o
  from ..frame import H2OFrame
  from ..job import H2OJob
  from .model_future import H2OModelFuture
  from .models.dim_reduction import H2ODimReductionModel
  from .models.autoencoder import H2OAutoEncoderModel
  from .models.multinomial import H2OMultinomialModel
  from .models.ordinal import H2OOrdinalModel
  from .models.regression import H2ORegressionModel
  from .models.binomial import H2OBinomialModel
  from .models.clustering import H2OClusteringModel
  from .models.word_embedding import H2OWordEmbeddingModel
label_desc: Use image node_id 1 for calling a global function with example usage: build_model(algo_params) and returns: _model_build