def _relative_selectivity(self, d):
    '\n        Return max_value_bin()) as a proportion of the sum_value().\n\n        This quantity is a measure of how strongly the distribution is\n        biased towards the max_value_bin().  For a smooth,\n        single-lobed distribution with an inclusive, non-cyclic range,\n        this quantity is an analog to vector_selectivity.  To be a\n        precise analog for arbitrary distributions, it would need to\n        compute some measure of the selectivity that works like the\n        weighted_average() instead of the max_value_bin().  The result\n        is scaled such that if all bins are identical, the selectivity\n        is 0.0, and if all bins but one are zero, the selectivity is\n        1.0.\n        '
    if (len(d.data()) <= 1):
        return 1.0
    proportion = d._safe_divide(max(d.values()), sum(d.values()))
    offset = (1.0 / len(d.values()))
    scaled = ((proportion - offset) / (1.0 - offset))
    if (scaled >= 0.0):
        return scaled
    else:
        return 0.0
Return max_value_bin()) as a proportion of the sum_value().

This quantity is a measure of how strongly the distribution is
biased towards the max_value_bin().  For a smooth,
single-lobed distribution with an inclusive, non-cyclic range,
this quantity is an analog to vector_selectivity.  To be a
precise analog for arbitrary distributions, it would need to
compute some measure of the selectivity that works like the
weighted_average() instead of the max_value_bin().  The result
is scaled such that if all bins are identical, the selectivity
is 0.0, and if all bins but one are zero, the selectivity is
1.0.
def _relative_selectivity(self, d):
    '\n        Return max_value_bin()) as a proportion of the sum_value().\n\n        This quantity is a measure of how strongly the distribution is\n        biased towards the max_value_bin().  For a smooth,\n        single-lobed distribution with an inclusive, non-cyclic range,\n        this quantity is an analog to vector_selectivity.  To be a\n        precise analog for arbitrary distributions, it would need to\n        compute some measure of the selectivity that works like the\n        weighted_average() instead of the max_value_bin().  The result\n        is scaled such that if all bins are identical, the selectivity\n        is 0.0, and if all bins but one are zero, the selectivity is\n        1.0.\n        '
    if (len(d.data()) <= 1):
        return 1.0
    proportion = d._safe_divide(max(d.values()), sum(d.values()))
    offset = (1.0 / len(d.values()))
    scaled = ((proportion - offset) / (1.0 - offset))
    if (scaled >= 0.0):
        return scaled
    else:
        return 0.0