Planar NNLS Embedding Projection
Spherical/L2 k-Means++ with closed-form non-negative least-squares projection onto planar triangles.
- Stage 02: Clustering & Projection
- Built-In Preset
- 2 min read
- requiresTags: false
- Updated 2026-11-16
Key Takeaways
- Use when you want exact geometric least-squares reconstruction weights onto planar mesh simplices.
- Supports sparse vertex/edge/triangle anchoring ('simplex-projection', 'explaining-away', or 'top-1') and optional contrastive feature naming.
Visual Mechanism
Factory Signature
@simplex-viz/core, @simplex-viz/svg, and @simplex-viz/reactStage 02 Overview →createEmbeddingClusteringStrategy<TItem, TTagMeta>(options: EmbeddingClusteringOptions<TItem>): SimplexClusteringStrategy<TItem, TTagMeta>Options & Defaults
(item: TItem) => readonly number[] | readonly EmbeddingSource<TItem>[]
Single or weighted multi-modal vector extractor.
readonly SubspaceZoomFeature<TItem>[] | undefined
Optional domain features scored against corpus base rates to assign pairwise-distinct defaultLabels across all K clusters.
number | undefined
Preferred number of k-Means++ centroids K.
'cosine' | 'euclidean'
Vector distance metric.
'simplex-projection' | 'explaining-away' | 'top-1'
Selects closed-form NNLS projection onto vertices, edges, and triangles.
number
Maximum Spherical/Lloyd k-Means refinement passes.
Closed-Form Planar NNLS Projection
For each item vector x, Planar NNLS Embedding Projection evaluates every candidate planar simplex τ (vertices, 1-hop mesh edges, and 60° mesh triangles) and solves the exact constrained quadratic program minimizing || x − ∑ w_i · μ_i ||₂² subject to w_i ≥ 0 and ∑ w_i = 1. Selecting the planar simplex with lowest reconstruction residual guarantees faithful geometric interpolation without cross-mesh tangling, while optional features automatically synthesize contrastive, collision-free labels across all K vertices.
Usage Example
import {
SimplexTopicGraph,
createEmbeddingClusteringStrategy,
} from '@simplex-viz/react';
const nnlsProjection = createEmbeddingClusteringStrategy<DocVector>({
getEmbedding: (doc) => doc.embedding,
clusterCount: 8,
metric: 'cosine',
anchorRule: 'simplex-projection',
});
<SimplexTopicGraph items={docs} clusteringStrategy={nnlsProjection} />;