class_docstr: A config spec for running ModelAgnostic evaluation.
class_docstr_tok: ["A","config","spec","for","running","ModelAgnostic","evaluation","."]
docstr: Creates a ModelAgnosticConfig instance.
  
  Creates a config spec for doing ModelAgnostic evaluation (Model evaluation
  without the training eval saved model). This spec defines the basic
  parameters with which to define Features, Predictions, and Labels from
  input Examples.
  
  Args:
    label_keys: A list of Text, the keys in the input examples which should be
      treated as labels. Currently, this cannot be empty.
    prediction_keys: A list of Text, the keys in the input examples which
      should be treated as predictions. Currently, this cannot be empty.
    feature_spec: In the case only FPL is provided (via Examples), a dict
      defining how to parse the example. This should be of the form "key" ->
      FixedLenFeature or VarLenFeature. This is required to parse input
      examples.
  
  Returns:
    A ModelAgnosticConfig instance.
  
  Raises:
    ValueError: This inputs supplied are properly defined..
docstr_tok: ["Creates","a","ModelAgnosticConfig","instance",".","Creates","a","config","spec","for","doing","ModelAgnostic","evaluation","(","Model","evaluation","without","the","training","eval","saved","model",")",".","This","spec","defines","the","basic","parameters","with","which","to","define","Features",",","Predictions",",","and","Labels","from","input","Examples",".","Args",":","label_keys",":","A","list","of","Text",",","the","keys","in","the","input","examples","which","should","be","treated","as","labels",".","Currently",",","this","can","not","be","empty",".","prediction_keys",":","A","list","of","Text",",","the","keys","in","the","input","examples","which","should","be","treated","as","predictions",".","Currently",",","this","can","not","be","empty",".","feature_spec",":","In","the","case","only","FPL","is","provided","(","via","Examples",")",",","a","dict","defining","how","to","parse","the","example",".","This","should","be","of","the","form","``","key","''","-",">","FixedLenFeature","or","VarLenFeature",".","This","is","required","to","parse","input","examples",".","Returns",":","A","ModelAgnosticConfig","instance",".","Raises",":","ValueError",":","This","inputs","supplied","are","properly","defined",".."]
code: def __new__(
      cls,
      label_keys: List[str],
      prediction_keys: List[str],
      feature_spec: Dict[str, Any],
  ):
      """Creates a ModelAgnosticConfig instance.
  
      Creates a config spec for doing ModelAgnostic evaluation (Model evaluation
      without the training eval saved model). This spec defines the basic
      parameters with which to define Features, Predictions, and Labels from
      input Examples.
  
      Args:
        label_keys: A list of Text, the keys in the input examples which should be
          treated as labels. Currently, this cannot be empty.
        prediction_keys: A list of Text, the keys in the input examples which
          should be treated as predictions. Currently, this cannot be empty.
        feature_spec: In the case only FPL is provided (via Examples), a dict
          defining how to parse the example. This should be of the form "key" ->
          FixedLenFeature or VarLenFeature. This is required to parse input
          examples.
  
      Returns:
        A ModelAgnosticConfig instance.
  
      Raises:
        ValueError: This inputs supplied are properly defined..
      """
  
      if not label_keys:
          raise ValueError(
              "ModelAgnosticConfig must have label keys set."
          )
      if not prediction_keys:
          raise ValueError(
              "ModelAgnosticConfig must have prediction keys set."
          )
      if not feature_spec:
          raise ValueError(
              "ModelAgnosticConfig must have feature_spec set."
          )
      for key in prediction_keys:
          if key not in feature_spec:
              raise ValueError(
                  "Prediction key %s not defined in feature_spec." % key
              )
      for key in label_keys:
          if key not in feature_spec:
              raise ValueError(
                  "Label key %s not defined in feature_spec." % key
              )
  
      return super(ModelAgnosticConfig, cls).__new__(
          cls,
          label_keys=label_keys,
          prediction_keys=prediction_keys,
          feature_spec=feature_spec,
      )
  
file_path: model-analysis/tensorflow_model_analysis/model_agnostic_eval/model_agnostic_predict.py
imports: from typing import Any, Dict, List, NamedTuple
  import tensorflow
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import encoding
  from tensorflow_model_analysis.eval_saved_model import util
  from tensorflow_model_analysis.utils import util
label_desc: Use image node_id 1 for calling the ModelAgnosticConfig obj's underlying member method code with example usage: obj.__new__(cls, label_keys, prediction_keys, feature_spec) and returns: super