code: def simple_linear_regressor(export_path, eval_export_path):
      """Trains and exports a simple linear regressor."""
  
      feature_spec = tf.feature_column.make_parse_example_spec(
          util.linear_columns(False)
      )
      eval_feature_spec = tf.feature_column.make_parse_example_spec(
          util.linear_columns(True)
          + [
              tf.feature_column.categorical_column_with_hash_bucket(
                  "slice_key", 100
              )
          ]
      )
  
      regressor = tf_estimator.LinearRegressor(
          feature_columns=util.linear_columns(),
          loss_reduction=tf.losses.Reduction.SUM,
      )
      regressor = tf_estimator.add_metrics(
          regressor, util.regressor_extra_metrics
      )
      regressor.train(
          input_fn=util.make_regressor_input_fn(
              tf.feature_column.make_parse_example_spec(
                  util.linear_columns(True)
              )
          ),
          steps=3000,
      )
  
      return util.export_model_and_eval_model(
          estimator=regressor,
          serving_input_receiver_fn=(
              tf_estimator.export.build_parsing_serving_input_receiver_fn(
                  feature_spec
              )
          ),
          eval_input_receiver_fn=export.build_parsing_eval_input_receiver_fn(
              eval_feature_spec, label_key="label"
          ),
          export_path=export_path,
          eval_export_path=eval_export_path,
      )
  
imports: import tensorflow
  from tensorflow import estimator
  from tensorflow_model_analysis.eval_saved_model import export
  from tensorflow_model_analysis.eval_saved_model.example_trainers import util
label_desc: Use image node_id 1 for calling a global function with example usage: simple_linear_regressor(export_path, eval_export_path) and returns: util