This is a Julia implementation of the Kneedle1 knee-finding algorithm. This detects "corners" (or "knees", "elbows", ...) in a dataset (x, y)
.
- Exports one main function
kneedle
with the ability to select the shape and number of knees to search for. - Built-in data smoothing from Loess.jl.
- Makie extension for quick visualization.
This package is in the Julia General Registry. In the Julia REPL, run the following code and follow the prompts:
import Pkg
Pkg.add("Kneedle")
Access the functionality of the package in your code by including the following line:
using Kneedle
Find a knee automatically using kneedle(x, y)
:
using Kneedle
x, y = Testers.CONCAVE_INC
kr = kneedle(x, y) # kr is a `KneedleResult`
knees(kr) # [2], therefore a knee is detected at x = 2
In order to use the plotting functionality, a Makie backend is required. For this example, this amounts to including the line import CairoMakie
. This provides access to the function viz(x, y, kr; kwargs...)
:
import CairoMakie
viz(x, y, kr, show_data_smoothed = false) # we didn't use any smoothing here, so no need to show it
-
kneed: Knee-finding in Python.
-
Yellowbrick: Machine learning visualization.
Footnotes
-
Satopaa, Ville, et al. Finding a "kneedle" in a haystack: Detecting knee points in system behavior. 2011 31st international conference on distributed computing systems workshops. IEEE, 2011. ↩