import math


def find_frac_cut_point(entropies, fraction=0.995):
    """
    Calculate a cut-off point from fraction of entropy distribution.
    Use case is with native entropy distribution to qualify on true negatives,
    under the assumption that loan entropies will be generally greater than native,
    and so result in low false negatives and high true positives.
    """
    # Entropies are not power law distributed, but neither are they Gaussian.
    # Better to use fraction of distribution rather than Gaussian z value
    # as cut-point for discriminating between native and loan.
    entropies = sorted(entropies)
    idx = min((len(entropies) - 1) * fraction, len(entropies) - 1)
    return (entropies[math.floor(idx)] + entropies[math.ceil(idx)]) / 2