Extremum
QuantConnect.Optimizer.Objectives.Extremum
Extremum(comparer: Callable[[float, float], bool])
Bases: Object
Define the way to compare current real-values and the new one (candidates). It's encapsulated in different abstraction to allow configure the direction of optimization, i.e. max or min.
Create an instance of Extremum to compare values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
comparer
|
Callable[[float, float], bool]
|
The way old and new values should be compared |
required |
better
better(current: float, candidate: float) -> bool
Compares two values; identifies whether condition is met or not.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
current
|
float
|
Left operand |
required |
candidate
|
float
|
Right operand |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Returns the result of comparer with this arguments. |