# tfma.utils.update_eval_config_with_defaults

<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/utils/config_util.py#L85-L226) |

Returns a new config with default settings applied.

    tfma.utils.update_eval_config_with_defaults(
        eval_config: https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/EvalConfig,
        maybe_add_baseline: Optional[bool] = None,
        maybe_remove_baseline: Optional[bool] = None,
        has_baseline: Optional[bool] = False,
        rubber_stamp: Optional[bool] = False
    ) -> https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/EvalConfig

a) Add or remove a model_spec according to "has_baseline".
b) Fix the model names (model_spec.name) to tfma.CANDIDATE_KEY and
tfma.BASELINE_KEY.
c) Update the metrics_specs with the fixed model name.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `eval_config` | Original eval config. |
| `maybe_add_baseline` | DEPRECATED. True to add a baseline ModelSpec to the config as a copy of the candidate ModelSpec that should already be present. This is only applied if a single ModelSpec already exists in the config and that spec doesn't have a name associated with it. When applied the model specs will use the names tfma.CANDIDATE_KEY and tfma.BASELINE_KEY. Only one of maybe_add_baseline or maybe_remove_baseline should be used. |
| `maybe_remove_baseline` | DEPRECATED. True to remove a baseline ModelSpec from the config if it already exists. Removal of the baseline also removes any change thresholds. Only one of maybe_add_baseline or maybe_remove_baseline should be used. |
| `has_baseline` | True to add a baseline ModelSpec to the config as a copy of the candidate ModelSpec that should already be present. This is only applied if a single ModelSpec already exists in the config and that spec doesn't have a name associated with it. When applied the model specs will use the names tfma.CANDIDATE_KEY and tfma.BASELINE_KEY. False to remove a baseline ModelSpec from the config if it already exists. Removal of the baseline also removes any change thresholds. Only one of has_baseline or maybe_remove_baseline should be used. |
| `rubber_stamp` | True if this model is being rubber stamped. When a model is rubber stamped diff thresholds will be ignored if an associated baseline model is not passed. |

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `RuntimeError` | on missing baseline model for non-rubberstamp cases. |

<br />