Constraints
Model constraints let you guide the structure of a model during training.
Use them when you already know that a feature or feature interaction should be included, excluded, or prioritised. Constraints can be passed directly to a training job or collected into constraint groups for reuse.
How constraints fit into training
Constraint behaviour
A constraint applies to one module. The module is described by the features in the constraint.
The API also accepts boolean values for include: true behaves like INCLUDE, and false behaves like EXCLUDE.
Use reason to record why the constraint exists, and weight to indicate how important the constraint is when several constraints apply.
To train only the modules defined by constraints, set exclude_implicit in the training configuration and do not set max_interactions.
Create and manage constraints
Create individual constraints for the modules you want to control. You can pass these constraints directly to a training job, even if you do not create a group.
Create a constraint
Create a constraint for the feature or interaction you want to include, exclude, or prioritise.
Save the returned constraint id. You will use it when assigning the constraint to a group or when creating a training job.
Retrieve constraints
Retrieve constraints when you need to reuse existing definitions or inspect how a module is constrained.
To inspect a specific constraint, retrieve it by id.
Update or delete a constraint
Update a constraint when you need to rename it.
Delete a constraint when it should no longer be used.
Work with constraint groups
Constraint groups collect related constraints so they can be applied together.
Use a group when the same set of constraints should be reused across multiple training jobs, or when you want to keep domain, policy, or modelling constraints together.
Create a group
Create a group before assigning constraints to it.
Save the returned group id. You will use it when assigning constraints and when creating a training job.
Retrieve groups
Retrieve groups when you need to reuse a group in a training job or inspect the constraints assigned to it.
To inspect a specific group, retrieve it by id.
Assign constraints to a group
Assign constraints after both the constraint and the group have been created.
Unassign constraints from a group
Unassign a constraint when it should no longer belong to the group.
Update or delete a group
Update a group when you need to rename it.
Delete a group when it should no longer be used.

