code: def _hyperband_paper_alg(R, eta=3):
      """
      Algorithm 1 from the Hyperband paper [1]_.
  
      References
      ----------
      1. "Hyperband: A novel bandit-based approach to hyperparameter
         optimization", 2016 by L. Li, K. Jamieson, G. DeSalvo, A. Rostamizadeh,
         and A. Talwalkar.  https://arxiv.org/abs/1603.06560
      """
      s_max = math.floor(math.log(R, eta))
      B = (s_max + 1) * R
      brackets = reversed(range(int(s_max + 1)))
      hists = {}
      for s in brackets:
          n = int(math.ceil(B / R * eta**s / (s + 1)))
          r = R * eta**-s
          r = int(r)
          T = set(range(n))
          hist = {
              "num_estimators": n,
              "estimators": {n: 0 for n in range(n)},
              "decisions": [],
          }
          for i in range(s + 1):
              n_i = math.floor(n * eta**-i)
              r_i = np.round(r * eta**i).astype(int)
              L = {model: r_i for model in T}
              hist["estimators"].update(L)
              hist["decisions"] += [r_i]
              to_keep = math.floor(n_i / eta)
              T = {model for i, model in enumerate(T) if i < to_keep}
          hists[s] = hist
      info = [
          {
              "bracket": k,
              "n_models": hist["num_estimators"],
              "partial_fit_calls": sum(hist["estimators"].values()),
              "decisions": {int(h) for h in hist["decisions"]},
          }
          for k, hist in hists.items()
      ]
      return info
  
file_path: dask-ml/dask_ml/model_selection/_hyperband.py
imports: from __future__ import division
  import asyncio
  import logging
  import math
  from typing import Any, Callable, Dict, Iterable, List, Tuple, Union
  from warnings import warn
  import numpy
  from sklearn.utils import check_random_state
  from ._incremental import BaseIncrementalSearchCV
  from ._successive_halving import SuccessiveHalvingSearchCV
label_desc: Use image node_id 4 for calling a global function with example usage: _hyperband_paper_alg(R, eta) and returns: info