UNPKG

clustering-tfjs

Version:

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

56 lines 1.94 kB
/** * Main entry point for the clustering library * * Provides initialization and configuration for multi-platform support. */ import { BackendConfig } from './tf-backend'; import { KMeans } from './clustering/kmeans'; import { SpectralClustering } from './clustering/spectral'; import { AgglomerativeClustering } from './clustering/agglomerative'; import type { DetectedPlatform } from './clustering-types'; export * from './clustering/types'; export { KMeans } from './clustering/kmeans'; export { SpectralClustering } from './clustering/spectral'; export { AgglomerativeClustering } from './clustering/agglomerative'; export { pairwiseDistanceMatrix } from './utils/pairwise_distance'; export { findOptimalClusters } from './utils/findOptimalClusters'; export type { Platform, DetectedPlatform, PlatformFeatures, ExtendedBackendConfig } from './clustering-types'; /** * Main clustering namespace with platform awareness */ export declare const Clustering: { /** * Current platform */ platform: DetectedPlatform; /** * Platform features */ features: import("./clustering-types").BackendFeatures; /** * Initialize the clustering library with the specified backend * * @param config - Backend configuration options * @returns Promise that resolves when the backend is ready * * @example * ```typescript * // Auto-detect best backend * await Clustering.init(); * * // Use specific backend * await Clustering.init({ backend: 'webgl' }); * * // With custom flags * await Clustering.init({ * backend: 'wasm', * flags: { 'WASM_HAS_SIMD_SUPPORT': true } * }); * ``` */ init(config?: BackendConfig): Promise<void>; KMeans: typeof KMeans; SpectralClustering: typeof SpectralClustering; AgglomerativeClustering: typeof AgglomerativeClustering; }; //# sourceMappingURL=clustering.d.ts.map