class KneeLocator(object):
"""
Finds the "elbow" or "knee" which is a value corresponding to the point of maximum curvature
in an elbow curve, using knee point detection algorithm. This point is accessible via the
`knee` attribute.
Parameters
----------
x : list
A list of k values representing the no. of clusters in KMeans Clustering algorithm.
y : list
A list of k scores corresponding to each value of k. The type of k scores are determined by the metric parameter from the KElbowVisualizer class.
S : float, default: 1.0
Sensitivity parameter that allows us to adjust how aggressive we want KneeLocator to
be when detecting "knees" or "elbows".
curve_nature : string, default: 'concave'
A string that determines the nature of the elbow curve in which "knee" or "elbow" is
to be found.
curve_direction : string, default: 'increasing'
A string that determines tha increasing or decreasing nature of the elbow curve in
which "knee" or "elbow" is to be found.
online : bool, default: False
kneed will correct old knee points if True, will return first knee if False
Notes
-----
The KneeLocator is implemented using the "knee point detection algorithm" which can be read at
`<https://www1.icsi.berkeley.edu/~barath/papers/kneedle-simplex11.pdf>`
@Haebuk had opened a PR to deal with this but closed it https://github.com/DistrictDataLabs/yellowbrick/pull/1233
We just need to add this line below to the KneeLocator docstring for
y
located in yellowbrick/utils/kneed.py"A list of k scores corresponding to each value of k. The type of k scores are determined by the metric parameter from the KElbowVisualizer class. "
https://github.com/DistrictDataLabs/yellowbrick/blob/092c0ca25187b3cde9f608a1f7bc6d8c2b998f96/yellowbrick/utils/kneed.py#L61-L62