# Module: tfma

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/model-analysis/blob/v0.46.0/tensorflow_model_analysis/__init__.py) |

Init module for TensorFlow Model Analysis.

## Modules

[`addons`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/addons) module: Init module for TensorFlow Model Analysis addons.

[`constants`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/constants) module: Constants used in TensorFlow Model Analysis.

[`contrib`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/contrib) module

[`evaluators`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/evaluators) module: Init module for TensorFlow Model Analysis evaluators.

[`experimental`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/experimental) module

[`export`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/export) module: Library for exporting the EvalSavedModel.

[`exporter`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/exporter) module: `Exporter` class represents different flavors of model export.

[`extractors`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/extractors) module: Init module for TensorFlow Model Analysis extractors.

[`metrics`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/metrics) module: Init module for TensorFlow Model Analysis metrics.

[`model_agnostic_eval`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/model_agnostic_eval) module: Init module for TensorFlow Model Analysis model_agnostic_eval.

[`post_export_metrics`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/post_export_metrics) module: Library containing helpers for adding post export metrics for evaluation.

[`sdk`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/sdk) module: SDK for TensorFlow Model Analysis.

[`types`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/types) module: Types.

[`utils`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/utils) module: Init module for TensorFlow Model Analysis utils.

[`validators`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/validators) module: Init module for TensorFlow Model Analysis validators.

[`version`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/version) module: Contains the version string for this release of TFMA.

[`view`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/view) module: Initializes TFMA's view rendering api.

[`writers`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/writers) module: Init module for TensorFlow Model Analysis writers.

## Classes

[`class AggregationOptions`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/AggregationOptions): A ProtocolMessage

[`class AttributionsForSlice`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/AttributionsForSlice): A ProtocolMessage

[`class BinarizationOptions`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/BinarizationOptions): A ProtocolMessage

[`class ConfidenceIntervalOptions`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/ConfidenceIntervalOptions): A ProtocolMessage

[`class CrossSliceMetricThreshold`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/CrossSliceMetricThreshold): A ProtocolMessage

[`class CrossSliceMetricThresholds`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/CrossSliceMetricThresholds): A ProtocolMessage

[`class CrossSlicingSpec`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/CrossSlicingSpec): A ProtocolMessage

[`class EvalConfig`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/EvalConfig): A ProtocolMessage

[`class EvalResult`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/EvalResult): The result of a single model analysis run.

[`class EvalSharedModel`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/types/EvalSharedModel): Shared model used during extraction and evaluation.

[`class ExampleWeightOptions`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/ExampleWeightOptions): A ProtocolMessage

[`class FeaturesPredictionsLabels`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/types/FeaturesPredictionsLabels): FeaturesPredictionsLabels(input_ref, features, predictions, labels)

[`class GenericChangeThreshold`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/GenericChangeThreshold): A ProtocolMessage

[`class GenericValueThreshold`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/GenericValueThreshold): A ProtocolMessage

[`class MaterializedColumn`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/types/MaterializedColumn): MaterializedColumn(name, value)

[`class MetricConfig`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/MetricConfig): A ProtocolMessage

[`class MetricThreshold`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/MetricThreshold): A ProtocolMessage

[`class MetricsForSlice`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/MetricsForSlice): A ProtocolMessage

[`class MetricsSpec`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/MetricsSpec): A ProtocolMessage

[`class ModelLoader`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/types/ModelLoader): Model loader is responsible for loading shared model types.

[`class ModelSpec`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/ModelSpec): A ProtocolMessage

[`class Options`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/Options): A ProtocolMessage

[`class PaddingOptions`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/PaddingOptions): A ProtocolMessage

[`class PerSliceMetricThreshold`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/PerSliceMetricThreshold): A ProtocolMessage

[`class PerSliceMetricThresholds`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/PerSliceMetricThresholds): A ProtocolMessage

[`class PlotsForSlice`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/PlotsForSlice): A ProtocolMessage

[`class RaggedTensorValue`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/types/RaggedTensorValue): RaggedTensorValue encapsulates a batch of ragged tensor values.

[`class RepeatedInt32Value`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/RepeatedInt32Value): A ProtocolMessage

[`class RepeatedStringValue`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/RepeatedStringValue): A ProtocolMessage

[`class SlicingSpec`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/SlicingSpec): A ProtocolMessage

[`class SparseTensorValue`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/types/SparseTensorValue): SparseTensorValue encapsulates a batch of sparse tensor values.

[`class ValidationResult`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/ValidationResult): A ProtocolMessage

[`class VarLenTensorValue`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/types/VarLenTensorValue): VarLenTensorValue encapsulates a batch of varlen dense tensor values.

## Functions

[`BatchedInputsToExtracts(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/BatchedInputsToExtracts): Converts Arrow RecordBatch inputs to Extracts.

[`ExtractAndEvaluate(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/ExtractAndEvaluate): Performs Extractions and Evaluations in provided order.

[`ExtractEvaluateAndWriteResults(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/ExtractEvaluateAndWriteResults): PTransform for performing extraction, evaluation, and writing results.

[`InputsToExtracts(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/InputsToExtracts): Converts serialized inputs (e.g. examples) to Extracts if not already.

[`Validate(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/Validate): Performs validation of alternative evaluations.

[`WriteResults(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/WriteResults): Writes Evaluation or Validation results using given writers.

[`analyze_raw_data(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/analyze_raw_data): Runs TensorFlow model analysis on a pandas.DataFrame.

[`default_eval_shared_model(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/default_eval_shared_model): Returns default EvalSharedModel.

[`default_evaluators(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/default_evaluators): Returns the default evaluators for use in ExtractAndEvaluate.

[`default_extractors(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/default_extractors): Returns the default extractors for use in ExtractAndEvaluate.

[`default_writers(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/default_writers): Returns the default writers for use in WriteResults.

[`is_batched_input(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/is_batched_input): Returns true if batched input should be used.

[`is_legacy_estimator(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/is_legacy_estimator): Returns true if there is a legacy estimator.

[`load_attributions(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/load_attributions): Read and deserialize the AttributionsForSlice records.

[`load_eval_result(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/load_eval_result): Loads EvalResult object for use with the visualization functions.

[`load_eval_results(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/load_eval_results): Loads results for multiple models or multiple data sets.

[`load_metrics(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/load_metrics): Read and deserialize the MetricsForSlice records.

[`load_plots(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/load_plots): Read and deserialize the PlotsForSlice records.

[`load_validation_result(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/load_validation_result): Read and deserialize the ValidationResult.

[`make_eval_results(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/make_eval_results): Run model analysis for a single model on multiple data sets.

[`multiple_data_analysis(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/multiple_data_analysis): Run model analysis for a single model on multiple data sets.

[`multiple_model_analysis(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/multiple_model_analysis): Run model analysis for multiple models on the same data set.

[`run_model_analysis(...)`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/run_model_analysis): Runs TensorFlow model analysis.

## Type Aliases

[`AddMetricsCallbackType`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/types/AddMetricsCallbackType)

[`Extracts`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/types/Extracts)

[`MaybeMultipleEvalSharedModels`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/types/MaybeMultipleEvalSharedModels)

[`TensorType`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/types/TensorType)

[`TensorTypeMaybeDict`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/types/TensorTypeMaybeDict)

[`TensorValue`](https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/types/TensorValue)

<br />

<br />

<br />

| ## Other Members ||
|---|---|
| ANALYSIS_KEY | `'analysis'` |
| ARROW_INPUT_COLUMN | `'__raw_record__'` |
| ARROW_RECORD_BATCH_KEY | `'arrow_record_batch'` |
| ATTRIBUTIONS_KEY | `'attributions'` |
| BASELINE_KEY | `'baseline'` |
| BASELINE_SCORE_KEY | `'baseline_score'` |
| CANDIDATE_KEY | `'candidate'` |
| DATA_CENTRIC_MODE | `'data_centric_mode'` |
| EXAMPLE_SCORE_KEY | `'example_score'` |
| EXAMPLE_WEIGHTS_KEY | `'example_weights'` |
| FEATURES_KEY | `'features'` |
| FEATURES_PREDICTIONS_LABELS_KEY | `'_fpl'` |
| INPUT_KEY | `'input'` |
| LABELS_KEY | `'labels'` |
| METRICS_KEY | `'metrics'` |
| MODEL_CENTRIC_MODE | `'model_centric_mode'` |
| MetricDirection | Instance of `google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper` |
| PLOTS_KEY | `'plots'` |
| PREDICTIONS_KEY | `'predictions'` |
| SLICE_KEY_TYPES_KEY | `'_slice_key_types'` |
| TFMA_EVAL | `'tfma_eval'` |
| TF_ESTIMATOR | `'tf_estimator'` |
| TF_GENERIC | `'tf_generic'` |
| TF_JS | `'tf_js'` |
| TF_KERAS | `'tf_keras'` |
| TF_LITE | `'tf_lite'` |
| VALIDATIONS_KEY | `'validations'` |
| VERSION_STRING | `'0.46.0'` |

<br />