class_docstr: Min label position metric.
  
  Calculates the least index in a query which has a positive label. The final
  returned value is the weighted average over all queries in the evaluation set
  which have at least one labeled entry. Note, ranking is indexed from one, so
  the optimal value for this metric is one. If there are no labeled rows in the
  evaluation set, the final output will be zero.
  
  This is a query/ranking based metric so a query_key must also be provided in
  the associated metrics spec.
class_docstr_tok: ["Min","label","position","metric",".","Calculates","the","least","index","in","a","query","which","has","a","positive","label",".","The","final","returned","value","is","the","weighted","average","over","all","queries","in","the","evaluation","set","which","have","at","least","one","labeled","entry",".","Note",",","ranking","is","indexed","from","one",",","so","the","optimal","value","for","this","metric","is","one",".","If","there","are","no","labeled","rows","in","the","evaluation","set",",","the","final","output","will","be","zero",".","This","is","a","query\/ranking","based","metric","so","a","query_key","must","also","be","provided","in","the","associated","metrics","spec","."]
docstr: Initializes min label position metric.
  
  Args:
    name: Metric name.
    label_key: Optional label key to override default label.
docstr_tok: ["Initializes","min","label","position","metric",".","Args",":","name",":","Metric","name",".","label_key",":","Optional","label","key","to","override","default","label","."]
code: def __init__(
      self,
      name=MIN_LABEL_POSITION_NAME,
      label_key: Optional[str] = None,
  ):
      """Initializes min label position metric.
  
      Args:
        name: Metric name.
        label_key: Optional label key to override default label.
      """
      super().__init__(
          _min_label_position, name=name, label_key=label_key
      )
  
file_path: model-analysis/tensorflow_model_analysis/metrics/min_label_position.py
imports: from typing import Dict, Iterable, List, Optional
  import apache_beam
  import numpy
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import util
label_desc: Use image node_id 1 to create a new MinLabelPosition object from inherited base classes: metric_types with example: obj = MinLabelPosition(name, label_key)