baybe.constraints.utils.is_cardinality_fulfilled

baybe.constraints.utils.is_cardinality_fulfilled(df: DataFrame, subspace_continuous: SubspaceContinuous, *, check_minimum: bool = True, check_maximum: bool = True)[source]

Validate cardinality constraints in a dataframe of parameter configurations.

Parameters:
  • df (DataFrame) – The dataframe to be checked.

  • subspace_continuous (SubspaceContinuous) – The subspace spanned by the considered parameters.

  • check_minimum (bool) – If True, minimum cardinality constraints are validated.

  • check_maximum (bool) – If True, maximum cardinality constraints are validated.

Return type:

bool

Returns:

True if all cardinality constraints are fulfilled, False otherwise.