pythonhyperopt

How to run Adaptive TPE in hyperopt?


I read documentation of Hyperopt in python, and I found, that there are three possible methods:

  1. RandomSearch
  2. TPE
  3. Adaptive TPE

To run random search we have command rand.suggest, and TPE tpe.suggest, however, I couldn't nowhere find any command which tells me how can I run adaptive TPE. Could you please tell me how it can be ran?


Solution

  • It isn't explained in the documentation, but by looking around in the GitHub issues I found that the Adaptive TPE implementation is where one might expect:

    from hyperopt import hp, fmin, atpe  # <-----
    
    # define the search space
    
    best = fmin(objective, space, algo=atpe.suggest, max_evals=100)