/** * Density-based clustering (DBSCAN) + k-nearest-neighbour classifier/regressor * (Phase 3 Task 4 — ML primitives). * * All three functions share brute-force Euclidean-distance neighbour search. * The library's exported `kdTree` (`typed/geometry.ts`) has no radius-query * method, so DBSCAN's ε-neighborhoods are computed O(n²) brute-force here — * correct, just not the asymptotically fastest option. A kd-tree range-search * (and a kd-tree-backed k-NN search) is future work if this becomes a hot path. */ /** * DBSCAN density-based clustering. A point is a **core point** if its * ε-neighborhood (including itself) has at least `minPts` members; clusters * are grown by expanding outward from core points through their neighbors * (density-reachability). Points reached only from a core point's * neighborhood but that are not themselves core are labeled as border points * of that cluster; points never reached are **noise** (`-1`). * * @param points - Row-vectors (n × d) * @param eps - Neighborhood radius (Euclidean) * @param minPts - Minimum neighborhood size (including the point itself) for a core point * @returns 0-based cluster label per point; `-1` marks noise * * @example * dbscan([[0, 0], [0.1, 0.1], [10, 10], [50, 50]], 1.0, 2) * // => [0, 0, -1, -1] (one 2-point cluster, two noise points) */ export declare function dbscan(points: number[][], eps: number, minPts: number): number[]; /** * k-nearest-neighbour classifier: majority vote of the `k` closest training * points (Euclidean distance). Ties are broken by the label of the single * nearest point among the tied labels. * * @param train - Training row-vectors (n × d) * @param labels - Training labels (length n) * @param query - Query row-vectors (m × d) * @param k - Number of neighbors * @returns Predicted label per query row */ export declare function knnClassify(train: number[][], labels: (number | string)[], query: number[][], k: number): (number | string)[]; /** * k-nearest-neighbour regressor: mean of the `k` closest training targets * (Euclidean distance). * * @param train - Training row-vectors (n × d) * @param targets - Training targets (length n) * @param query - Query row-vectors (m × d) * @param k - Number of neighbors * @returns Predicted (mean) target per query row */ export declare function knnRegress(train: number[][], targets: number[], query: number[][], k: number): number[]; //# sourceMappingURL=dbscan-knn.d.ts.map