tfl.configs.DominanceConfig

View source on GitHub

Class 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', trust_type='monotonic'),
            ],
        ),
        tfl.configs.FeatureConfig(
            name='num_clicks',
        ),
    ])

__init__

View source

__init__(
    feature_name,
    dominance_type='monotonic'
)

Initializes a DominanceConfig instance.

Args:

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