Skip to content

Setting early_stopping_timeout to None is not handled correctly #290

@VadimsAhmers

Description

@VadimsAhmers

While working with FEDOT, I discovered that the early_stopping_timeout parameter cannot be set to None. Attempting to do so results in the following errors:

>       lambda: self.generations.stagnation_time_duration >= max_stagnation_time,
        'Optimisation finished: Early stopping timeout criteria was satisfied'
    )
E   TypeError: '>=' not supported between instances of 'float' and 'datetime.timedelta'

../../golem/core/optimisers/populational_optimizer.py:75: TypeError

when timeout parameter is set and

>       lambda: self.generations.stagnation_time_duration >= max_stagnation_time,
        'Optimisation finished: Early stopping timeout criteria was satisfied'
    )
E   TypeError: '>=' not supported between instances of 'float' and 'NoneType'

../../golem/core/optimisers/populational_optimizer.py:75: TypeError

when both early_stopping_timeout and timeout parameters are None

Current Workaround:

Currently, to disable this parameter, one can use early_stopping_timeout=np.inf instead.

Expected Behavior:

Setting early_stopping_timeout=None should:

  • Be accepted as a valid parameter value
  • Effectively disable the early stopping timeout functionality

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions