twinlab.Emulator.maximize#

Emulator.maximize(params=<twinlab.params.MaximizeParams object>, wait=True, verbose=True)[source]#

Finding the maximum the output of a trained emulator that exists on the twinLab cloud.

This method of an emulator is used to find the point in the input space that maximizes the output of your trained emulator. This method is useful for finding the best possible input for your model, given the emulator predictions. This can help provide guidance for how best to configure your experiment, for example. This method can be used in a stand-alone manner to find the maximum, or at the end of a Bayesian optimization loop to find the best possible input. See the documentation for MaximizeParams() for more information on the available parameters.

This method can also be used to minimize an output, by using the opt_weight argument of MaximizeParams to multiply the output by -1. If an emulator has more-than-one output, then a weighted combination of the outputs can be minimized/maximized: The opt_weight argument of MaximizeParams can control the weight assigned to each output, or can be used to focus on a single output.

Parameters:
  • params (MaximizeParams) – A parameter-configuration that contains optional parameters for finding the input that produces the maximum model output.

  • wait (bool, optional) – If True wait for the job to complete, otherwise return the process ID and exit.

  • verbose (bool, optional) – Display detailed information about the operation while running.

Returns:

By default, a Dataframe containing the input that optimises your emulator predictions. Instead, if wait=False, the process ID is returned. The results can then be retrieved later using Emulator.get_process(<process_id>). Process IDs associated with an emulator can be found using Emulator.list_processes().

Return type:

Tuple[pandas.DataFrame], str

Example

emulator = tl.Emulator("quickstart")
emulator.maximize()
          X
0  0.845942