saealib.Result#
- class saealib.Result(x, f, fe, gen, ctx, history=None)[ソース]#
ベースクラス:
objectOptimization result returned by
minimize()/maximize().x/f/fe/genare fixed at creation time (the arrays are copied).ctx/history/archive/pareto_archive/populationare references derived from the state and may change while iteration is still in progress.- パラメータ:
x (np.ndarray | None)
f (np.ndarray)
fe (int)
gen (int)
ctx (OptimizationState)
history (History | None)
- x#
Best design variables. Shape
(dim,)for single-objective,(n_pareto, dim)for multi-objective.Nonefor non-dense spaces; useproblem.space.servicesto convertresult.ctx.archive.genomeswhen dense design variables are needed.- Type:
np.ndarray or None
- f#
Best objective values. Shape
(n_obj,)for single-objective,(n_pareto, n_obj)for multi-objective.- Type:
np.ndarray
- fe#
Total number of true function evaluations used.
- Type:
int
- gen#
Total number of generations completed.
- Type:
int
- history#
Execution history recorded during the run.
- Type:
History or None
- ctx#
Full optimization context providing access to the archive and more.
- Type:
OptimizationState
Methods
Build a result from the final or currently observed state. |
|
Return one scalar value per recorded history generation. |
Method Details
- Result.__init__(x, f, fe, gen, ctx, history=None)#
- パラメータ:
x (np.ndarray | None)
f (np.ndarray)
fe (int)
gen (int)
ctx (OptimizationState)
history (History | None)
- 戻り値の型:
None
- classmethod Result.from_state(state)[ソース]#
Build a result from the final or currently observed state.
Result feasibility uses
problem.eps_cvand intentionally differs fromproblem.handler.feasibility_threshold.- パラメータ:
state (OptimizationState)
- 戻り値の型:
- Result.history_series(value, *, x='fe', channel=None, **value_kwargs)[ソース]#
Return one scalar value per recorded history generation.
- パラメータ:
value (str or callable) -- Registered value name, or a callable mapping one history record to a scalar. A callable also requires channel.
x ({"fe", "gen", "decision_count"}, optional) -- Column supplying the independent coordinate.
channel (str, optional) -- History channel whose records feed a callable value.
**value_kwargs -- Arguments required by the registered value:
reference_pointfor"hypervolume",reference_frontfor"gd","gd_plus","igd","igd_plus"and"spread".
- 戻り値:
The series and the display names of its two coordinates.
- 戻り値の型:
HistorySeries
- 例外:
ValidationError -- If x or value is unknown, the channel the value needs was not recorded, or a reference argument has the wrong shape.
メモ
A reference is supplied in the objective space of the problem, the same orientation as
Result.f. Front and reference are both converted to minimize-space before an indicator runs, and neither is normalized, so an indicator value keeps raw objective units.Indicators read the
frontchannel, a per-generation snapshot of the Pareto archive holding objective values alone, with no constraint violation column. That archive judges feasibility by its owneps_cv, which the built-in algorithms leave at0.0, so it admits a solution as feasible only at exactly zero violation. While it holds no such solution, constrained dominance reduces the front to the lowest-cv solutions and an indicator over that generation describes an infeasible front;front_sizecollapsing to a single point is the visible sign.Feasibility elsewhere in the series rests on different thresholds:
"best"selects from the archive underproblem.eps_cv, and"feasible_ratio"counts the population under the runningproblem.handler.feasibility_threshold. The three are independent and can disagree, most visibly while epsilon is relaxed.