soogo.optimize_result module

OptimizeResult class for Soogo package.

class soogo.optimize_result.OptimizeResult(x: ndarray | None = None, fx: float | ndarray | None = None, nit: int = 0, nfev: int = 0, sample: ndarray | None = None, fsample: ndarray | None = None, nobj: int = 1) None

Bases: object

Optimization result for the global optimizers provided by this package.

fsample: Optional[ndarray] = None

Vector with all n objective values

fx: Union[float, ndarray, None] = None

Best objective function value

init(fun, bounds, mineval: int, maxeval: int, surrogateModel: Surrogate, ntarget: int = 1) None

Initialize nfev and sample and fsample with data about the optimization that is starting.

This routine calls the objective function nfev times.

By default, all targets are considered to be used in the objective. If that is not the case, set nobj after calling this function.

Parameters:
  • fun – The objective function to be minimized.

  • bounds (sequence) – List with the limits [x_min,x_max] of each direction x in the space.

  • mineval (int) – Minimum number of function evaluations to build the surrogate model.

  • maxeval (int) – Maximum number of function evaluations.

  • surrogateModel (Surrogate) – Surrogate model to be used.

  • ntarget (int) – Number of target dimensions. Default is 1. (default: 1)

Return type:

None

init_best_values(surrogateModel: Surrogate | None = None) None

Initialize x and fx based on the best values obtained so far.

Parameters:

surrogateModel (Optional[Surrogate]) – Surrogate model. (default: None)

Return type:

None

nfev: int = 0

Number of function evaluations taken

nit: int = 0

Number of active learning iterations

nobj: int = 1

Number of objective function targets

sample: Optional[ndarray] = None

n-by-dim matrix with all n samples

x: Optional[ndarray] = None

Best sample point found so far