Documentation
¶
Overview ¶
Package knee reads a threshold from data. The knee of an empirical distribution is the point of its cumulative curve farthest from the chord between the curve's ends, the place where a sparse tail turns into a dense body. A threshold taken this way is always an observed value, so a bound or an acceptance level is never a number typed into the source: the caller reports the quantile the knee sits at beside every use, and a change in the data moves the threshold.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Index ¶
Index returns the index of the point of the cumulative curve over x that lies farthest from the chord between the curve's ends. x holds the x-coordinate of each rank in ascending order; the point for rank i is (x[i], (i+1)/len(x)). Fewer than two points has no chord and Index returns zero.
Types ¶
type Result ¶
type Result struct {
Threshold float64 `json:"threshold"`
Quantile float64 `json:"quantile"`
Samples int `json:"samples"`
}
Result is a threshold read from a sample: the value at the knee, the quantile it sits at, and how many points it was read from.