tpcp.OptimizableAlgorithm#

class tpcp.OptimizableAlgorithm[source]#

Base class for algorithms with distinct parameter optimization.

Methods

clone()

Create a new instance of the class with all parameters copied over.

get_params([deep])

Get parameters for this algorithm.

self_optimize(*args, **kwargs)

Optimize the input parameter of the algorithm using any logic.

set_params(**params)

Set the parameters of this Algorithm.

__init__(*args, **kwargs)#
clone() typing_extensions.Self[source]#

Create a new instance of the class with all parameters copied over.

This will create a new instance of the class itself and all nested objects

get_params(deep: bool = True) Dict[str, Any][source]#

Get parameters for this algorithm.

Parameters
deep

Only relevant if object contains nested algorithm objects. If this is the case and deep is True, the params of these nested objects are included in the output using a prefix like nested_object_name__ (Note the two “_” at the end)

Returns
params

Parameter names mapped to their values.

self_optimize(*args: Any, **kwargs: Any) typing_extensions.Self[source]#

Optimize the input parameter of the algorithm using any logic.

This method can be used to adapt the input parameters (values provided in the init) based on any data-driven heuristic.

Note

The optimizations must only modify the input parameters that are marked as optiparas/optimizable_parameters.

Returns
self

The class instance with optimized input parameters.

set_params(**params: Any) typing_extensions.Self[source]#

Set the parameters of this Algorithm.

To set parameters of nested objects use nested_object_name__para_name=.

Examples using tpcp.OptimizableAlgorithm#