code: def _get_hyperparameters() -> kt.HyperParameters:
      """Creates a small hyperparameter search space for TF-DF.
  
      TF-DF offers multiple learning algorithms, and each one has its own
      hyperparameters. In this example, we consider the Random Forest and Gradient
      Boosted Trees models.
  
      Their hyperparameters are described at:
  
      https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/GradientBoostedTreesModel
      https://www.tensorflow.org/decision_forests/api_docs/python/tfdf/keras/RandomForestModel
      https://github.com/google/yggdrasil-decision-forests/blob/main/documentation/learners.md
  
      See the user manual to get an idea of which hyperparameters are best suited
      for tuning:
      https://github.com/google/yggdrasil-decision-forests/blob/main/documentation/user_manual.md#manual-tuning-of-hyper-parameters
  
      Returns:
        Valid range and default value of few of the GBT hyperparameters.
      """
      hp = kt.HyperParameters()
  
      # Select the decision forest learning algorithm.
      hp.Choice(
          _KEY_MODEL_TYPE,
          [
              _KEY_RANDOM_FOREST,
              _KEY_GRADIENT_BOOSTED_TREES,
          ],
          default=_KEY_GRADIENT_BOOSTED_TREES,
      )
  
      # Hyperparameter for the Random Forest
      hp.Int(
          "max_depth",
          10,
          24,
          default=16,
          parent_name=_KEY_MODEL_TYPE,
          parent_values=[_KEY_RANDOM_FOREST],
      )
      hp.Int(
          "min_examples",
          2,
          20,
          default=6,
          parent_name=_KEY_MODEL_TYPE,
          parent_values=[_KEY_RANDOM_FOREST],
      )
  
      # Hyperparameters for the Gradient Boosted Trees
      hp.Float(
          "num_candidate_attributes_ratio",
          0.5,
          1.0,
          default=1.0,
          parent_name=_KEY_MODEL_TYPE,
          parent_values=[_KEY_GRADIENT_BOOSTED_TREES],
      )
      hp.Boolean(
          "use_hessian_gain",
          default=False,
          parent_name=_KEY_MODEL_TYPE,
          parent_values=[_KEY_GRADIENT_BOOSTED_TREES],
      )
      hp.Choice(
          "growing_strategy",
          ["LOCAL", "BEST_FIRST_GLOBAL"],
          default="LOCAL",
          parent_name=_KEY_MODEL_TYPE,
          parent_values=[_KEY_GRADIENT_BOOSTED_TREES],
      )
  
      return hp
  
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 1 for calling a global function with example usage: _get_hyperparameters() and returns: hp