Skip to content

Commit

Permalink
Change the e2e tests to use out-of-graph metrics other than in-graph …
Browse files Browse the repository at this point in the history
…ones due to TF2.2 will stop exposing in-graph metrics APIs.

PiperOrigin-RevId: 312108536
  • Loading branch information
tfx-copybara committed May 18, 2020
1 parent 62ba786 commit 4518409
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
20 changes: 10 additions & 10 deletions tfx/examples/chicago_taxi_pipeline/taxi_pipeline_native_keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,16 @@ def _create_pipeline(pipeline_name: Text, pipeline_root: Text, data_root: Text,
model_specs=[tfma.ModelSpec(label_key='tips')],
slicing_specs=[tfma.SlicingSpec()],
metrics_specs=[
tfma.MetricsSpec(
thresholds={
'binary_accuracy':
tfma.config.MetricThreshold(
value_threshold=tfma.GenericValueThreshold(
lower_bound={'value': 0.6}),
change_threshold=tfma.GenericChangeThreshold(
direction=tfma.MetricDirection.HIGHER_IS_BETTER,
absolute={'value': -1e-10}))
})
tfma.MetricsSpec(metrics=[
tfma.MetricConfig(
class_name='BinaryAccuracy',
threshold=tfma.MetricThreshold(
value_threshold=tfma.GenericValueThreshold(
lower_bound={'value': 0.6}),
change_threshold=tfma.GenericChangeThreshold(
direction=tfma.MetricDirection.HIGHER_IS_BETTER,
absolute={'value': -1e-10})))
])
])
evaluator = Evaluator(
examples=example_gen.outputs['examples'],
Expand Down
20 changes: 10 additions & 10 deletions tfx/examples/iris/iris_pipeline_native_keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,16 @@ def _create_pipeline(pipeline_name: Text, pipeline_root: Text, data_root: Text,
model_specs=[tfma.ModelSpec(label_key='variety')],
slicing_specs=[tfma.SlicingSpec()],
metrics_specs=[
tfma.MetricsSpec(
thresholds={
'sparse_categorical_accuracy':
tfma.config.MetricThreshold(
value_threshold=tfma.GenericValueThreshold(
lower_bound={'value': 0.6}),
change_threshold=tfma.GenericChangeThreshold(
direction=tfma.MetricDirection.HIGHER_IS_BETTER,
absolute={'value': -1e-10}))
})
tfma.MetricsSpec(metrics=[
tfma.MetricConfig(
class_name='SparseCategoricalAccuracy',
threshold=tfma.MetricThreshold(
value_threshold=tfma.GenericValueThreshold(
lower_bound={'value': 0.6}),
change_threshold=tfma.GenericChangeThreshold(
direction=tfma.MetricDirection.HIGHER_IS_BETTER,
absolute={'value': -1e-10})))
])
])
evaluator = Evaluator(
examples=example_gen.outputs['examples'],
Expand Down

0 comments on commit 4518409

Please sign in to comment.