Appendix
This chapter has details on some of SACOBRA_Py’s data structures.
With
cobra = CobraInitializer(...)
we generate the main data structure cobra of SACOBRA_Py (see CobraInitializer).
Some of its data frame and dictionary elements are described below.
cobra.sac_opts
SACoptions cobra.sac_opts holds the collection of all parameters (options) for SACOBRA_Py.
cobra.sac_res
cobra.sac_res is a dictionary which holds SACOBRA_Py’s results from the initialization phase and from the optimization phase.
- cobraInit.CobraInitializer.get_sac_res(self)
Return dictionary
sac_reswith the following elements, accessible with e.g.sac_res['fn']:fn: function returning
(1+nConstraints)-dim vector: [objective to minimize, constraints], optionally rescaledoriginalfn: the same, but before rescaling
lower: lower-bound vector with dimension \(d\), optionally rescaled
originalL: the same, but before rescaling
upper: upper-bound vector with dimension \(d\), optionally rescaled
originalU: the same, but before rescaling
x0: initial start point, either given with the problem formulation or a random point, optionally resacled
originalx0: the same, but before rescaling
xStart: start point for each sequential optimization: initially
x0, but in later iterations replaced byxbestor random startdimension: input space dimension \(d\)
nConstraints: number of constraints
is_equ: boolean vector of size
nConstraints:Trueifn’th constraint is equality constraintA: matrix
(p2.num, dimension)holding the initial design + all infill pointsFres: vector of size
p2.num: objective value for each point inAGres: matrix
(p2.num, nConstraints): constraint values for each point inApredC: matrix
(p2.num, nConstraints): predicted constraint values for each point inA. The prediction of the current infill point is made with the current constraint surrogates which are formed from thep2.num - 1previous points.muVec: vector of size
p2.num: \(\mu\) in thei’th iterationnumViol, trueNumViol, maxViol, trueMaxViol: same as columns nViolations, trueNViol, maxViolation, trueMaxViol of cobra.df
fbestArray: vector of size
p2.num: best feasible objective value in thei’th iteration…
p2.numcounts the number of real function evaluations, seePhase2Varsp2.- Returns:
SACOBRA results
- Return type:
cobra.df
cobra.df is a data frame which holds diagnostic information about the optimization process.
df is only for diagnostics, its elements are not used by the optimization process in any form.
- cobraPhaseII.CobraPhaseII.get_df(self) DataFrame
Return data frame
cobra.dfwith the following elements, accessible with e.g.cobra.df['iter']. Data framecobra.dfcontainsfevalrows, one for each true function evaluation.The contents of a specific row of
cobra.dfholds the results of a specific iteration (current iteration):iter: the iteration number
y: the objective function value at the current infill point
predY: the fitness surrogate value at the current infill point
predSolu: the fitness surrogate value at the true solution (if provided, else none)
feasible: is the current infill point feasible on the true objective?
feasPred: is the current infill point predicted to be feasible by the surrogate models?
nViolations: the number of violations in the constraint surrogates’ prediction at the infill point
trueNViol: the number of violations in the true constraints at the infill point
maxViolation: the maximum violation of the constraint surrogates’ prediction at the infill point
trueMaxViol: the maximum violation of the true constraints at the infill point
feMax: the number of iterates that the sequential optimizer took when producing this infill point
fBest: the all-time best feasible objective value. As long as no feasible point is found, the fitness of the one with the least maximum violation
dist: distance of the true solution to infill point, in rescaled space. Minimum distance for multiple solu’s, None if no solu is provided
distOrig: the same, but in original space
RS: True if it is an iteration with a random start
XI: DRC for this iteration
optimConv: convergence of sequential optimization
optimTime: time of this sequential optimization
optimizer: optimization algorithm
seed:
`sac_opts.cobraSeed…
- Returns:
SACOBRA diagnostic information
- Return type:
pd.DataFrame
cobra.df2
cobra.df2 is a data frame which holds diagnostic information about the optimization process.
df2 is only for diagnostics, its elements are not used by the optimization process in any form.
- cobraPhaseII.CobraPhaseII.get_df2(self) DataFrame
Return data frame
cobra.df2with the following elements, accessible with e.g.cobra.df2['iter']. Data framecobra.df2containsfeval - initDesPointsrows, one for each true function evaluation in phase II.The contents of a specific row of
cobra.df2holds the results of a specific iteration, the current iteration:iter: the iteration number
predY: the fitness surrogate value at the current infill point
predVal: surrogate fitness + penalty at xNew
predSolu: the fitness surrogate value at the true solution (if provided, else none)
predSoluPenal: surrogate fitness + penalty at the true solu (only diagnostics)
sigmaD: …
penaF: …
XI: DRC for this iteration
rho: smoothing factor \(\rho\) (interpolating / approximating RBFs)
fBest: the all-time best feasible objective value. As long as no feasible point is found, the fitness of the one with the least maximum violation
EPS: the current safety margin EPS in constraint surrogates
muVec: artificial equality constraint enlargement \(\mu\)
PLOG: whether \(plog\) transformation is used in the current iteration (see p-Effect)
pshift: shift used in \(plog\) transformation (see p-Effect)
pEffect: the p-Effect value
state: name of iteration state [‘initialized’ | ‘optimized’ | ‘refined’]
Only if the COP contains equality constraints and if equality handling is active (
EQUoptionsEQU.active==True), then the following row elements are notNone, instead they contain these attributes evaluated for the current infill point:nv_cB: number of (artificial) constraint violations (
> conTol) before refine on surrogatesnv_cA: number of (artificial) constraint violations (
> conTol) after refine on surrogatesnv_tB: number of (artificial) constraint violations (
> conTol) before refine on true constraintsnv_tA: number of (artificial) constraint violations (
> conTol) after refine on true constraints
- Returns:
SACOBRA diagnostic information
- Return type:
pd.DataFrame