tfl.configs.DominanceConfig

Configuration for dominance constraints in TFL canned estimators.

You can specify how a feature dominantes another feature. Supported dominance types (see tfl.layers.Lattice and 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',
        ),
    ])

feature_name Name of the "dominant" feature for the dominance constraint.
dominance_type Type of dominance constraint. Currently, supports 'monotonic'.

Methods

deserialize_nested_configs

View source

Returns a deserialized configuration dictionary.

from_config

View source

get_config

View source

Returns a configuration dictionary.