@saehrimnir/druidjs
Clustering
| Class | Description |
|---|---|
| CURE | CURE (Clustering Using REpresentatives) |
| HierarchicalClustering | Hierarchical Clustering |
| KMeans | K-Means Clustering |
| KMedoids | K-Medoids (PAM - Partitioning Around Medoids) |
| MeanShift | Mean Shift Clustering |
| OPTICS | OPTICS (Ordering Points To Identify the Clustering Structure) |
| XMeans | X-Means Clustering |
Data Structures
| Class | Description |
|---|---|
| DisjointSet | - |
| Heap | - |
Dimensionality Reduction
| Class | Description |
|---|---|
| FASTMAP | FastMap algorithm for dimensionality reduction. |
| ISOMAP | Isomap (Isometric Mapping) |
| KKMDS | Kamada-Kawai Multidimensional Scaling (KKMDS) |
| LDA | Linear Discriminant Analysis (LDA) |
| LLE | Locally Linear Embedding (LLE) |
| LocalMAP | LocalMAP |
| LSP | Least Square Projection (LSP) |
| LTSA | Local Tangent Space Alignment (LTSA) |
| MDS | Classical Multidimensional Scaling (MDS) |
| MINFOTree | Minimum Information Trees (MINFO Trees) |
| PaCMAP | Pairwise Controlled Manifold Approximation Projection (PaCMAP) |
| PCA | Principal Component Analysis (PCA) |
| SAMMON | Sammon's Mapping |
| SMACOF | Metric Multidimensional Scaling (MDS) via SMACOF. |
| SQDMDS | SQuadMDS (Stochastic Quartet MDS) |
| StressMDS | Weighted metric MDS (stress majorization family) |
| TopoMap | TopoMap |
| TriMap | TriMap |
| TSNE | t-SNE (t-Distributed Stochastic Neighbor Embedding) |
| UMAP | Uniform Manifold Approximation and Projection (UMAP) |
KNN
| Class | Description |
|---|---|
| Annoy | Annoy-style (Approximate Nearest Neighbors Oh Yeah) implementation using Random Projection Trees. |
| BallTree | Ball Tree for efficient nearest neighbor search. |
| HNSW | Hierarchical Navigable Small World (HNSW) graph for approximate nearest neighbor search. |
| KDTree | KD-Tree (K-dimensional Tree) for efficient nearest neighbor search. |
| LSH | Locality Sensitive Hashing (LSH) for approximate nearest neighbor search. |
| NaiveKNN | Naive KNN implementation performing an exhaustive scan. |
| NNDescent | NN-Descent |
Linear Algebra
| Function | Description |
|---|---|
| inner_product | - |
| qr | Computes the QR Decomposition of the Matrix A using Gram-Schmidt process. |
| qr_householder | Computes the QR Decomposition of the Matrix A with householder transformations. |
| simultaneous_poweriteration | Computes the k biggest Eigenvectors and Eigenvalues from Matrix A with the QR-Algorithm. |
Matrix
| Name | Description |
|---|---|
| Matrix | - |
| distance_matrix | Computes the distance matrix of datamatrix A. |
| k_nearest_neighbors | Computes the k-nearest neighbors of each row of A. |
| linspace | Creates an Array containing number numbers from start to end. If number = null. |
| norm | Computes the norm of a vector, by computing its distance to 0. |
| normalize | Normalizes Vector v. |
Metrics
| Function | Description |
|---|---|
| bray_curtis | Computes the Bray-Curtis distance between a and b. |
| canberra | Computes the canberra distance between a and b. |
| chebyshev | Computes the chebyshev distance (L∞) between a and b. |
| cosine | Computes the cosine distance (not similarity) between a and b. |
| euclidean | Computes the euclidean distance (l_2) between a and b. |
| euclidean_squared | Computes the squared euclidean distance (l_2^2) between a and b. |
| goodman_kruskal | Computes the Goodman-Kruskal gamma coefficient for ordinal association. |
| hamming | Computes the hamming distance between a and b. |
| haversine | Computes the Haversine distance between two points on a sphere of unit length 1. Multiply the result with the radius of the sphere. (For instance Earth's radius is 6371km) |
| jaccard | Computes the jaccard distance between a and b. |
| manhattan | Computes the manhattan distance (l_1) between a and b. |
| sokal_michener | Computes the Sokal-Michener distance between a and b. |
| wasserstein | Computes the 1D Wasserstein distance (Earth Mover's Distance) between two distributions. |
| yule | Computes the yule distance between a and b. |
Numerical
| Function | Description |
|---|---|
| kahan_sum | Numerical stable summation with the Kahan summation algorithm. |
| neumair_sum | Numerical stable summation with the Neumair summation algorithm. |
Optimization
| Function | Description |
|---|---|
| powell | - |
Other
| Name | Description |
|---|---|
| EigenArgs | - |
| ParametersAnnoy | - |
| ParametersBallTree | - |
| ParametersCURE | - |
| ParametersFASTMAP | - |
| ParametersHierarchicalClustering | - |
| ParametersHNSW | - |
| ParametersISOMAP | - |
| ParametersKDTree | - |
| ParametersKMeans | - |
| ParametersKMedoids | - |
| ParametersLDA | - |
| ParametersLLE | - |
| ParametersLocalMAP | - |
| ParametersLSH | - |
| ParametersLSP | - |
| ParametersLTSA | - |
| ParametersMDS | - |
| ParametersMeanShift | - |
| ParametersMINFOTree | - |
| ParametersNaiveKNN | - |
| ParametersNNDescent | - |
| ParametersOptics | - |
| ParametersPaCMAP | - |
| ParametersPCA | - |
| ParametersSAMMON | - |
| ParametersSMACOF | - |
| ParametersSQDMDS | - |
| ParametersStressMDS | - |
| ParametersTopoMap | - |
| ParametersTriMap | - |
| ParametersTSNE | - |
| ParametersUMAP | - |
| ParametersXMeans | - |
| Comparator | - |
| InputType | - |
| Metric | - |
| ParametersKKMDS | - |
| QRDecomposition | - |
| WeightSpec | - |
| version | - |
| WEIGHTS_ELASTIC | Elastic scaling, also known as the Kamada-Kawai energy. See KKMDS. |
| WEIGHTS_SAMMON | Sammon stress. Recovers the objective SAMMON minimises, up to a constant factor. |
| WEIGHTS_UNIFORM | Raw stress: every pair counts equally. Recovers the objective SMACOF minimises. |
| isWasmAvailable | Returns whether WASM acceleration is available in current environment. |
| isWasmThreadsSupported | Returns whether SharedArrayBuffer and WASM multi-threading is supported in current environment (Node.js, Bun, Deno, or Web Browser with COOP/COEP headers). |
| minimum_spanning_tree | Computes a minimum spanning tree of a weighted graph with Kruskal's algorithm. |
| parallel_available | Whether row-range kernels can be split across workers in this environment. |
| quickselect | In-place QuickSelect algorithm to partition an array around the k-th smallest element. Runs in O(N) average time complexity (compared to O(N log N) for full Array.prototype.sort). |
| quickselectByAxis | QuickSelect by specific dimension axis for spatial trees (KDTree, BallTree). Partitions array in-place along arr[i].element[axis]. |
| setWasmEnabled | Enables or disables WASM acceleration at runtime. |
| spatial_tree | Picks the fastest spatial index that is still correct for the given metric. |
| terminate_pool | Stops the workers. They are unreferenced, so this is only needed to release them early. |
Utils
| Name | Description |
|---|---|
| Randomizer | Seeded pseudo-random number generator. |
| max | Returns maximum in Array values. |
| min | Returns maximum in Array values. |