code: def _build_estimator(config, hidden_units=None, warm_start_from=None):
      """Build an estimator for predicting the tipping behavior of taxi riders.
  
      Args:
        config: tf.estimator.RunConfig defining the runtime environment for the
          estimator (including model_dir).
        hidden_units: [int], the layer sizes of the DNN (input layer first)
        warm_start_from: Optional directory to warm start from.
  
      Returns:
        A dict of the following:
          - estimator: The estimator that will be used for training and eval.
          - train_spec: Spec for training.
          - eval_spec: Spec for eval.
          - eval_input_receiver_fn: Input function for eval.
      """
      real_valued_columns = [
          tf.feature_column.numeric_column(key, shape=())
          for key in features.transformed_names(
              features.DENSE_FLOAT_FEATURE_KEYS
          )
      ]
  
      categorical_columns = []
      for key in features.transformed_names(
          features.VOCAB_FEATURE_KEYS
      ):
          categorical_columns.append(
              tf.feature_column.categorical_column_with_identity(
                  key,
                  num_buckets=features.VOCAB_SIZE + features.OOV_SIZE,
                  default_value=0,
              )
          )
  
      for key, num_buckets in zip(
          features.transformed_names(features.BUCKET_FEATURE_KEYS),
          features.BUCKET_FEATURE_BUCKET_COUNT,
      ):
          categorical_columns.append(
              tf.feature_column.categorical_column_with_identity(
                  key, num_buckets=num_buckets, default_value=0
              )
          )
  
      for key, num_buckets in zip(
          features.transformed_names(features.CATEGORICAL_FEATURE_KEYS),
          features.CATEGORICAL_FEATURE_MAX_VALUES,
      ):
          categorical_columns.append(
              tf.feature_column.categorical_column_with_identity(
                  key, num_buckets=num_buckets, default_value=0
              )
          )
  
      return tf_estimator.DNNLinearCombinedClassifier(
          config=config,
          linear_feature_columns=categorical_columns,
          dnn_feature_columns=real_valued_columns,
          dnn_hidden_units=hidden_units or [100, 70, 50, 25],
          warm_start_from=warm_start_from,
      )
  
file_path: tfx/tfx/experimental/templates/taxi/models/estimator_model/model.py
imports: from absl import logging
  import tensorflow
  from tensorflow import estimator
  import tensorflow_model_analysis
  import tensorflow_transform
  from tensorflow_transform.tf_metadata import schema_utils
  from tfx import v1
  from tfx.experimental.templates.taxi.models import features
  from tfx.experimental.templates.taxi.models.estimator_model import constants
  from tfx_bsl.public import tfxio
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: _build_estimator(config, hidden_units, warm_start_from) and returns: tf_estimator