You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vark1=KneedleAlgorithm.CalculateKneePoints(x, y, CurveDirection.Decreasing, Curvature.Counterclockwise, forceLinearInterpolation: false);
24
+
// Returns 4
25
+
26
+
vark2=KneedleAlgorithm.CalculateKneePoints(x, y, CurveDirection.Decreasing, Curvature.Clockwise, forceLinearInterpolation: false);
27
+
// Returns 2
12
28
29
+
```
13
30
14
31
## Inputs
15
-
Needs the data points provided x-sorted.
16
32
17
-
Positive curvature is when the tangent traces anti-clockwise.
33
+
**x**: X axis values of the points. Points must be sorted in ascending order w.r.t. X axis.
34
+
35
+
**y**: Y axis values of the points.
36
+
37
+
**direction**: If the curve is increasing or decreasing. Make sure to set this value according to the input curve.
38
+
39
+
**concavity**: Whether the curve has positive or negative curvature. In other words, concave or convex. Whether the tangent rotates clockwise or counterclockwise. Make sure to set this value according to the input curve.
40
+
41
+
**sensitivity**: Adjusts the knee detection threshold. Defaults to 1 as per the paper.
42
+
43
+
**forceLinearInterpolation**: Interpolation is done using robust cubic splines. For some inputs, spline can overshoot. This param forces linear interpolation instead of cubic spline.
18
44
19
45
## Output
20
46
Returns the x value corresponding to the knee point.
@@ -23,3 +49,6 @@ Can return null when the algorithm fails to identify a knee/elbow for various re
23
49
- the number of data points is too small
24
50
- there are no local maxima on the diffs, which means either the curve is a line, or the parameters provided are incompatible with the curve
0 commit comments