# tfl.configs.DominanceConfig

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/configs.py#L1051-L1099) |

Configuration for dominance constraints in TFL canned estimators.

    tfl.configs.DominanceConfig(
        feature_name, dominance_type='monotonic'
    )

You can specify how a feature dominantes another feature. Supported dominance
types (see [`tfl.layers.Lattice`](https://www.tensorflow.org/lattice/api_docs/python/tfl/layers/Lattice) and [`tfl.layers.Linear`](https://www.tensorflow.org/lattice/api_docs/python/tfl/layers/Linear) for details):

- `'monotonic'`: Monotonic dominance constrains the function to require the effect (slope) in the direction of the *dominant* dimension to be greater than that of the *weak* dimension for any point in both lattice and linear models. Both dominant and weak dimensions must be monotonic. The constraint is guranteed to satisfy at the end of training for linear models, but might not be strictly satisified for lattice models. In such cases, increase the number of projection iterations.

#### Example:

    model_config = tfl.configs.CalibratedLatticeConfig(
        feature_configs=[
            tfl.configs.FeatureConfig(
                name='num_purchases',
                dominates=[
                    configs.DominanceConfig(
                        feature_name='num_clicks', dominance_type='monotonic'),
                ],
            ),
            tfl.configs.FeatureConfig(
                name='num_clicks',
            ),
        ])

<br />

<br />

<br />

| ## Args ||
|---|---|
| `feature_name` | Name of the `"dominant"` feature for the dominance constraint. |
| `dominance_type` | Type of dominance constraint. Currently, supports `'monotonic'`. |

<br />

## Methods

### `deserialize_nested_configs`

[View source](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/configs.py#L124-L158)

    @classmethod
    deserialize_nested_configs(
        config, custom_objects=None
    )

Returns a deserialized configuration dictionary.

### `from_config`

[View source](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/configs.py#L1096-L1099)

    @classmethod
    from_config(
        config, custom_objects=None
    )

### `get_config`

[View source](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/configs.py#L93-L122)

    get_config()

Returns a configuration dictionary.