class_docstr: Builds a tf.estimator.Estimator for a TF-Ranking model.
  
  An example use case is provided below:
  
  ```python
  import tensorflow as tf
  import tensorflow_ranking as tfr
  
  def scoring_function(context_features, example_features, mode):
    # ...
    # scoring logic
    # ...
    return scores # tensors with shape [batch_size, ...]
  
  context_feature_columns = {
    "c1": tf.feature_column.numeric_column("c1", shape=(1,))
  }
  example_feature_columns = {
    "e1": tf.feature_column.numeric_column("e1", shape=(1,))
  }
  hparams = dict(
      checkpoint_secs=120,
      listwise_inference=False,
      loss="softmax_loss",
      model_dir="/path/to/your/model_dir/",
      num_checkpoints=100)
  ranking_estimator = tfr.estimator.EstimatorBuilder(
        context_feature_columns,
        example_feature_columns,
        scoring_function=scoring_function,
        hparams=hparams).make_estimator()
  ```
  
  If you want to customize certain `EstimatorBuilder` behaviors, please create
  a subclass of `EstimatorBuilder`, and overwrite related functions. Right now,
  we recommend only overwriting the `_eval_metric_fns` for your eval metrics.
  For instance, if you need MAP (Mean Average Precision) as your evaluation
  metric, you can do the following:
  
  ```python
  class MyEstimatorBuilder(tfr.estimator.EstimatorBuilder):
    def _eval_metric_fns(self):
      metric_fns = {}
      metric_fns.update({
          "metric/ndcg@%d" % topn: tfr.metrics.make_ranking_metric_fn(
              tfr.metrics.RankingMetricKey.MAP, topn=topn) for topn in [5, 10]
      })
      return metric_fns
  
  # Then, you can define your estimator with:
  ranking_estimator = MyEstimatorBuilder(
        context_feature_columns,
        example_feature_columns,
        scoring_function=scoring_function,
        hparams=hparams).make_estimator()
  ```
  
  If you really need to overwrite other functions, particularly `_transform_fn`,
  `_group_score_fn` and `model_fn`, please be careful because the passed-in
  parameters might no longer be used.
class_docstr_tok: ["Builds","a","tf.estimator.Estimator","for","a","TF-Ranking","model",".","An","example","use","case","is","provided","below",":","``","`","python","import","tensorflow","as","tf","import","tensorflow_ranking","as","tfr","def","scoring_function","(","context_features",",","example_features",",","mode",")",":","#","...","#","scoring","logic","#","...","return","scores","#","tensors","with","shape","[","batch_size",",","...","]","context_feature_columns","=","{","``","c1","''",":","tf.feature_column.numeric_column","(","``","c1","''",",","shape=","(","1",",",")",")","}","example_feature_columns","=","{","``","e1","''",":","tf.feature_column.numeric_column","(","``","e1","''",",","shape=","(","1",",",")",")","}","hparams","=","dict","(","checkpoint_secs=120",",","listwise_inference=False",",","loss=","''","softmax_loss","''",",","model_dir=","''","\/path\/to\/your\/model_dir\/","''",",","num_checkpoints=100",")","ranking_estimator","=","tfr.estimator.EstimatorBuilder","(","context_feature_columns",",","example_feature_columns",",","scoring_function=scoring_function",",","hparams=hparams",")",".make_estimator","(",")","``","`","If","you","want","to","customize","certain","`","EstimatorBuilder","`","behaviors",",","please","create","a","subclass","of","`","EstimatorBuilder","`",",","and","overwrite","related","functions",".","Right","now",",","we","recommend","only","overwriting","the","`","_eval_metric_fns","`","for","your","eval","metrics",".","For","instance",",","if","you","need","MAP","(","Mean","Average","Precision",")","as","your","evaluation","metric",",","you","can","do","the","following",":","``","`","python","class","MyEstimatorBuilder","(","tfr.estimator.EstimatorBuilder",")",":","def","_eval_metric_fns","(","self",")",":","metric_fns","=","{","}","metric_fns.update","(","{","``","metric\/ndcg","@","%","d","''","%","topn",":","tfr.metrics.make_ranking_metric_fn","(","tfr.metrics.RankingMetricKey.MAP",",","topn=topn",")","for","topn","in","[","5",",","10","]","}",")","return","metric_fns","#","Then",",","you","can","define","your","estimator","with",":","ranking_estimator","=","MyEstimatorBuilder","(","context_feature_columns",",","example_feature_columns",",","scoring_function=scoring_function",",","hparams=hparams",")",".make_estimator","(",")","``","`","If","you","really","need","to","overwrite","other","functions",",","particularly","`","_transform_fn","`",",","`","_group_score_fn","`","and","`","model_fn","`",",","please","be","careful","because","the","passed-in","parameters","might","no","longer","be","used","."]
docstr: Returns the built `tf.estimator.Estimator` for the TF-Ranking model.
docstr_tok: ["Returns","the","built","`","tf.estimator.Estimator","`","for","the","TF-Ranking","model","."]
code: def make_estimator(self):
      """Returns the built `tf.estimator.Estimator` for the TF-Ranking model."""
      config = tf_estimator.RunConfig(  # pylint: disable=g-deprecated-tf-checker
          model_dir=self._hparams.get("model_dir"),
          keep_checkpoint_max=self._hparams.get("num_checkpoints"),
          save_checkpoints_secs=self._hparams.get("checkpoint_secs"),
      )
      return tf_estimator.Estimator(
          model_fn=self._model_fn(), config=config
      )
  
imports: import tensorflow
  from tensorflow import estimator
  from tensorflow.python.util import function_utils
  from tensorflow_ranking.python import feature
  from tensorflow_ranking.python import head
  from tensorflow_ranking.python import losses
  from tensorflow_ranking.python import metrics
  from tensorflow_ranking.python import model
  from tensorflow_ranking.python import utils
label_desc: Use image node_id 12 for calling the EstimatorBuilder obj's underlying member method code with example usage: obj.make_estimator() and returns: tf_estimator