UNPKG

clusterkw

Version:

A package for clustering keywords using OpenAI embeddings

14 lines (13 loc) 437 B
import { Cluster } from '../types'; /** * K-means clustering algorithm * @param keywords Array of keywords to cluster * @param embeddings Matrix of embeddings for each keyword * @param options Configuration options * @returns Array of clusters */ export declare function kmeansClustering(keywords: string[], embeddings: number[][], options: { k?: number; maxIterations?: number; minClusterSize?: number; }): Cluster[];