A Scikit-Learn implementation of the NTarp clustering algorithm, originally introduced here and developed further here.
The objective function of NTarp is the minimum normalized within-ss, and so this also necessarily includes an efficient way of computing this. The method used here is comparable to CKmeans.1d.dp in terms of algorithmic efficiency, but roughly twice as fast in practice (at least in my testing).
pip install ntarp
The main interface is the ntarp.NTarp
object, which uses the sklearn cluster interface, through the fit
and predict
methods. In addition the withinss function is available as ntarp.separability.w
.