clustering-tfjs
Version:
High-performance TypeScript clustering algorithms (K-Means, Spectral, Agglomerative) with TensorFlow.js acceleration and scikit-learn compatibility
50 lines • 1.83 kB
TypeScript
import type { DataMatrix, LabelVector, AgglomerativeClusteringParams, BaseClustering } from './types';
/**
* Agglomerative (hierarchical) clustering estimator skeleton.
*
* Only the constructor, parameter validation and public property definitions
* are implemented as part of this initial task. The actual clustering logic
* will be added in subsequent tasks.
*/
export declare class AgglomerativeClustering implements BaseClustering<AgglomerativeClusteringParams> {
/**
* Hyper-parameters describing the behaviour of this instance.
*/
readonly params: AgglomerativeClusteringParams;
/**
* Cluster labels produced by `fit` / `fitPredict`.
*
* Populated after calling `fit`.
*/
labels_: LabelVector | null;
/**
* Children of each non-leaf node in the hierarchical clustering tree.
* Shape: `(nSamples-1, 2)` where each row gives the indices of the merged
* clusters. Lazily populated by future implementation.
*/
children_: number[][] | null;
/**
* Number of leaves in the hierarchical clustering tree (equals `nSamples`).
*/
nLeaves_: number | null;
/**
* Allowed linkage strategies.
*/
private static readonly VALID_LINKAGES;
/**
* Allowed distance metrics.
*/
private static readonly VALID_METRICS;
constructor(params: AgglomerativeClusteringParams);
/**
* Fits the estimator to the provided data matrix.
*
* Note: The actual algorithm is not implemented yet. The stub only exists so
* the public interface is complete and unit tests can assert that the method
* is callable.
*/
fit(_X: DataMatrix): Promise<void>;
fitPredict(_X: DataMatrix): Promise<LabelVector>;
private static validateParams;
}
//# sourceMappingURL=agglomerative.d.ts.map