Domain
Constraints
Bases: BaseModel
, Generic[C]
Source code in bofire/data_models/domain/constraints.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
__call__(experiments)
Numerically evaluate all constraints
Parameters:
Name | Type | Description | Default |
---|---|---|---|
experiments
|
DataFrame
|
data to evaluate the constraint on |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: Constraint evaluation for each of the constraints |
Source code in bofire/data_models/domain/constraints.py
43 44 45 46 47 48 49 50 51 52 53 |
|
get(includes=Constraint, excludes=None, exact=False)
Get constraints of the domain
Parameters:
Name | Type | Description | Default |
---|---|---|---|
includes
|
Union[Type[CIncludes], Sequence[Type[CIncludes]]]
|
Constraint class or list of specific constraint classes to be returned. Defaults to Constraint. |
Constraint
|
excludes
|
Optional[Union[Type[CExcludes], List[Type[CExcludes]]]]
|
Constraint class or list of specific constraint classes to be excluded from the return. Defaults to None. |
None
|
exact
|
bool
|
Boolean to distinguish if only the exact class listed in includes and no subclasses inherenting from this class shall be returned. Defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
Constraints |
Constraints[CIncludes]
|
constraints in the domain fitting to the passed requirements. |
Source code in bofire/data_models/domain/constraints.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
get_reps_df()
Provides a tabular overwiev of all constraints within the domain
Returns:
Type | Description |
---|---|
pd.DataFrame: DataFrame listing all constraints of the domain with a description |
Source code in bofire/data_models/domain/constraints.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
is_fulfilled(experiments, tol=1e-06)
Check if all constraints are fulfilled on all rows of the provided dataframe
Parameters:
Name | Type | Description | Default |
---|---|---|---|
experiments
|
DataFrame
|
Dataframe with data, the constraint validity should be tested on |
required |
tol
|
float
|
tolerance parameter. A constraint is considered as not fulfilled if the violation is larger than tol. Defaults to 0. |
1e-06
|
Returns:
Name | Type | Description |
---|---|---|
Boolean |
Series
|
True if all constraints are fulfilled for all rows, false if not |
Source code in bofire/data_models/domain/constraints.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
jacobian(experiments)
Numerically evaluate the jacobians of all constraints
Parameters:
Name | Type | Description | Default |
---|---|---|---|
experiments
|
DataFrame
|
data to evaluate the constraint jacobians on |
required |
Returns:
Name | Type | Description |
---|---|---|
list |
list
|
A list containing the jacobians as pd.DataFrames |
Source code in bofire/data_models/domain/constraints.py
55 56 57 58 59 60 61 62 63 64 65 |
|