squlearn.optimizers.SLSQP

class squlearn.optimizers.SLSQP(options: dict = None, callback=<function default_callback>)

Wrapper class for scipy’s SLSQP implementation.

Parameters:

options (dict) – Options for the SLSQP optimizer. The options are the same as for scipy.optimize.minimize()

minimize(fun: callable, x0: ndarray, grad: callable = None, bounds=None) OptimizerResult

Function to minimize a given function using the SLSQP optimizer. Is wrapped from scipy.

Parameters:
  • fun (callable) – Function to minimize.

  • x0 (numpy.ndarray) – Initial guess.

  • grad (callable) – Gradient of the function to minimize.

  • bounds (sequence) – Bounds for the parameters.

Returns:

OptimizerResult format.

Return type:

Result of the optimization in class

set_callback(callback)

Set the callback function with additional iteration counter increasing.