Reputation: 10204
I am using scipy.optimize.basinhopping to minimize a function. Here is what I get:
Out[96]:
nfev: 162178
minimization_failures: 2501
fun: 4.4702905615653705
x: array([-194.7754468])
message: ['requested number of basinhopping iterations completed successfully']
njev: 44057
nit: 2500
However, I have difficulties in understanding the output. What are the meaning of these returned parameters:
nfev
minimization_failures
njev
nit
I guess nfev = number of function evaluation, and nit should correspond to 'number of iteration'. But why are nit != nfev?
Upvotes: 3
Views: 3740
Reputation: 4928
Some of the outputs are documented in scipy.optimize.OptimizeResult
:
nfev
: number of function evaluationsnjev
: number of Jacobian evaluationsnit
: number of iterations of the algorithmThe other options are less well documented, but you can always look at the Github source to understand. minimization_failures
refers to the number of times the local optimizer failed to converge (this might happen if the Monte Carlo step proposes a starting position for the local optimizer that is too far from the local minimum).
nit
, the number of iterations of the basin-hopping algorithm, is expected to be much less than nfev
, the number of function evaluations. An iteration corresponds to the following steps:
There will be many function evaluations as part of the local minimization procedure, hence we expect nfev
to be much bigger than nit
.
Upvotes: 8