import math


def guess_iterations(num_entities: int) -> int:
    """Guesses the number of iterations required for convergence.

    This is just a heuristic; the actual number depends heavily on the data
    and hyperparameters.

    Parameters
    ----------
    num_entities
        The number of ratings that need to be estimated.

    Returns
    -------
    int
        An estimate of the number of iterations of Newton's method required for
        the WHR estimates to converge.
    """
    return max(64, 2 * int(math.sqrt(1 + num_entities)))