Objectives
CloseToTarget
Bases: Objective
Source code in opti/objective.py
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 |
|
__init__(name, target=0, exponent=1, tolerance=0)
Objective for getting as close as possible to a given value.
s(y) = |y - target| ** exponent - tolerance ** exponent
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
output to optimize |
required |
target
|
float
|
target value |
0
|
exponent
|
float
|
exponent of the difference |
1
|
tolerance
|
float
|
only when used as output constraint. distance to target below which no further improvement is required |
0
|
Source code in opti/objective.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
Maximize
Bases: Objective
Source code in opti/objective.py
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 |
|
__init__(name, target=0)
Maximization objective
s(y) = target - y
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
output to maximize |
required |
target
|
float
|
only when used as output constraint. value above which no further improvement is required |
0
|
Source code in opti/objective.py
54 55 56 57 58 59 60 61 62 63 64 |
|
untransform(y)
Undo the transformation from output to objective value
Source code in opti/objective.py
69 70 71 |
|
Minimize
Bases: Objective
Source code in opti/objective.py
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 |
|
__init__(name, target=0)
Minimization objective
s(y) = y - target
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
output to minimize |
required |
target
|
float
|
only when used as output constraint. value below which no further improvement is required |
0
|
Source code in opti/objective.py
24 25 26 27 28 29 30 31 32 33 34 |
|
untransform(y)
Undo the transformation from output to objective value
Source code in opti/objective.py
39 40 41 |
|
Objective
Source code in opti/objective.py
9 10 11 12 13 14 15 16 17 18 19 20 |
|
__call__(df)
Evaluate the objective values for given output values.
Source code in opti/objective.py
14 15 16 |
|
__init__(name)
Base class for optimzation objectives.
Source code in opti/objective.py
10 11 12 |
|
to_config()
Return a json-serializable dictionary of the objective.
Source code in opti/objective.py
18 19 20 |
|
Objectives
Container for optimization objectives.
Objectives can be either used to quantify the optimility or as a constraint on the viability of output values (chance / feasibility constraint)
Source code in opti/objective.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
|
bounds(outputs)
Compute the bounds in objective space based on the output space bounds.
The bounds can be interpreted as the ideal and nadir points.
Examples for continuous parameters
min y for y in [0, 10] -> ideal = 0, nadir = 10 max y for y in [0, 10] -> ideal = -10, nadir = 0 min (y - 7)2 for y in [0, 10] -> ideal = 0, nadir = 72
Parameters:
Name | Type | Description | Default |
---|---|---|---|
outputs
|
Parameters
|
Output parameters. |
required |
Source code in opti/objective.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
|
get(types)
Get all parameters of the given type(s).
Source code in opti/objective.py
185 186 187 |
|
make_objective(type, name, **kwargs)
Make an objective from a configuration.
obj = make_objective(**config)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type
|
str
|
objective type |
required |
name
|
str
|
output to optimize |
required |
Source code in opti/objective.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
|