UNPKG

clustering-tfjs

Version:

High-performance TypeScript clustering algorithms (K-Means, Spectral, Agglomerative) with TensorFlow.js acceleration and scikit-learn compatibility

15 lines 848 B
import * as tf from '../tf-adapter'; /** * Creates component indicator features for disconnected graphs. * * For a graph with k connected components, this creates indicator features * where each feature has a constant value for all nodes in that component. * This mimics the behavior of sklearn's shift-invert eigenvectors. * * @param componentLabels - Array indicating which component each node belongs to * @param numComponents - Total number of components detected * @param maxIndicators - Maximum number of indicator vectors to create (usually nClusters) * @returns Component indicator matrix (n_samples x min(numComponents, maxIndicators)) */ export declare function createComponentIndicators(componentLabels: Int32Array, numComponents: number, maxIndicators: number): tf.Tensor2D; //# sourceMappingURL=component_indicators.d.ts.map