agglomerative
agglomerative(
data,k,options?):Uint32Array<ArrayBufferLike>
Defined in: packages/pleco-xa/src/segment/index.js:559
Bottom-up temporal segmentation: partition frames into k contiguous segments by temporally-constrained agglomerative clustering. Mirrors sklearn’s AgglomerativeClustering with Ward linkage on a chain connectivity graph: repeatedly merge the ADJACENT pair of segments with minimum Ward increment d²(A, B) = (nA·nB / (nA + nB)) · ||centroid(A) − centroid(B)||² until k segments remain.
Parameters
Section titled “Parameters”any[] | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>
features, shape (d, n) 2D,
or flat with explicit options.nFeatures/options.nFrames.
number
number of segments (1 <= k <= n_frames).
options?
Section titled “options?”any = {}
{ nFeatures, nFrames } for flat input.
Returns
Section titled “Returns”Uint32Array<ArrayBufferLike>
left-boundary frame indices (always starts with 0).