code: def _make_keras_model(hparams: kt.HyperParameters) -> tf.keras.Model:
      """Creates a TF-DF Keras model.
  
      Args:
        hparams: Hyperparameters of the model.
  
      Returns:
        A Keras Model.
      """
  
      # Note: The input features are not specified. Therefore, all the columns
      # specified in the Transform are used as input features, and their semantic
      # (e.g. numerical, categorical) is inferred automatically.
      common_args = {
          "verbose": 2,
          "task": tfdf.keras.Task.CLASSIFICATION,
      }
  
      if hparams.get(_KEY_MODEL_TYPE) == _KEY_RANDOM_FOREST:
          return tfdf.keras.RandomForestModel(
              max_depth=hparams.get("max_depth"),
              min_examples=hparams.get("min_examples"),
              **common_args,
          )
  
      elif hparams.get(_KEY_MODEL_TYPE) == _KEY_GRADIENT_BOOSTED_TREES:
          return tfdf.keras.GradientBoostedTreesModel(
              num_candidate_attributes_ratio=hparams.get(
                  "num_candidate_attributes_ratio"
              ),
              use_hessian_gain=hparams.get("use_hessian_gain"),
              growing_strategy=hparams.get("growing_strategy"),
              **common_args,
          )
  
      else:
          raise ValueError("Unknown model type")
  
file_path: tfx/tfx/examples/penguin/penguin_utils_tfdf_experimental.py
imports: from typing import List
  import keras_tuner
  import tensorflow
  import tensorflow_decision_forests
  import tensorflow_transform
  from tfx import v1
  from tfx.examples.penguin import penguin_utils_base
  from tfx_bsl.public import tfxio
label_desc: Use image node_id 2 for calling a global function with example usage: _make_keras_model(hparams) and returns: tfdf, tfdf