Runs TensorFlow model analysis.
tfma.run_model_analysis(
eval_shared_model: Optional[tfma.types.EvalSharedModel
] = None,
eval_config: Optional[tfma.EvalConfig
] = None,
data_location: str = '',
file_format: str = 'tfrecords',
output_path: Optional[str] = None,
extractors: Optional[List[extractor.Extractor]] = None,
evaluators: Optional[List[evaluator.Evaluator]] = None,
writers: Optional[List[writer.Writer]] = None,
pipeline_options: Optional[Any] = None,
slice_spec: Optional[List[slicer.SingleSliceSpec]] = None,
write_config: Optional[bool] = True,
compute_confidence_intervals: Optional[bool] = False,
min_slice_size: int = 1,
random_seed_for_testing: Optional[int] = None,
schema: Optional[schema_pb2.Schema] = None
) -> Union[tfma.EvalResult
, view_types.EvalResults]
Used in the notebooks
Used in the guide |
Used in the tutorials |
|
|
It runs a Beam pipeline to compute the slicing metrics exported in TensorFlow
Eval SavedModel and returns the results.
This is a simplified API for users who want to quickly get something running
locally. Users who wish to create their own Beam pipelines can use the
Evaluate PTransform instead.
Args |
eval_shared_model
|
Optional shared model (single-model evaluation) or list
of shared models (multi-model evaluation). Only required if needed by
default extractors, evaluators, or writers.
|
eval_config
|
Eval config.
|
data_location
|
The location of the data files.
|
file_format
|
The file format of the data, can be either 'text' or
'tfrecords' for now. By default, 'tfrecords' will be used.
|
output_path
|
The directory to output metrics and results to. If None, we use
a temporary directory.
|
extractors
|
Optional list of Extractors to apply to Extracts. Typically
these will be added by calling the default_extractors function. If no
extractors are provided, default_extractors (non-materialized) will be
used.
|
evaluators
|
Optional list of Evaluators for evaluating Extracts. Typically
these will be added by calling the default_evaluators function. If no
evaluators are provided, default_evaluators will be used.
|
writers
|
Optional list of Writers for writing Evaluation output. Typically
these will be added by calling the default_writers function. If no writers
are provided, default_writers will be used.
|
pipeline_options
|
Optional arguments to run the Pipeline, for instance
whether to run directly.
|
slice_spec
|
Deprecated (use EvalConfig).
|
write_config
|
Deprecated (use EvalConfig).
|
compute_confidence_intervals
|
Deprecated (use EvalConfig).
|
min_slice_size
|
Deprecated (use EvalConfig).
|
random_seed_for_testing
|
Provide for deterministic tests only.
|
schema
|
Optional tf.Metadata schema of the input data.
|
Returns |
An EvalResult that can be used with the TFMA visualization functions.
|
Raises |
ValueError
|
If the file_format is unknown to us.
|