maxCoverage returns the maximum coverage achievable for the data range.
(dMin, dMax, span float64)
| 227 | // maxCoverage returns the maximum coverage achievable for the data |
| 228 | // range. |
| 229 | func maxCoverage(dMin, dMax, span float64) float64 { |
| 230 | r := dMax - dMin |
| 231 | if span <= r { |
| 232 | return 1 |
| 233 | } |
| 234 | h := 0.5 * (span - r) |
| 235 | r *= 0.1 |
| 236 | return 1 - (h*h)/(r*r) |
| 237 | } |
| 238 | |
| 239 | // density returns the density score which measures the goodness of |
| 240 | // the labelling density compared to the user defined target |