gmmclusterer

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package gmmclusterer is an optional, host-wired vector clusterer for fabriq context distillation. It implements agent.Clusterer over embedding vectors (NeedsVectors()=true) as a deterministic k-means — a pragmatic alternative to the in-core multi-probe SimHash default. True GMM+UMAP is a documented extension; this keeps core import-clean (lives in forgeext, stdlib-only).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clusterer

type Clusterer struct {
	// contains filtered or unexported fields
}

Clusterer is a deterministic k-means vector clusterer.

Recall cluster-coverage note: recall's digestCovers pruning uses ParseClusterID to test whether a cluster digest's prefix covers an entity's SimHash Bucket. This Clusterer derives cluster ids from centroid hashes (see clusterID), which share the ClusterID wire format but occupy a different keyspace than the SimHash buckets used by the in-core SimHashClusterer. As a result, cluster digests produced by this Clusterer will under-prune in recall (a few extra entity rows may survive the dedup pass) but will NEVER false-prune — no relevant entity is dropped. This is a safe no-op; it does not affect correctness, only recall window compactness.

func New

func New(k, idBits int) *Clusterer

New builds a k-means clusterer producing up to k clusters; idBits sizes the cluster-id prefix (mirrors the SimHash cluster id shape).

func (*Clusterer) Cluster

func (c *Clusterer) Cluster(_ context.Context, inputs []agent.ClusterInput, noiseFloor int) ([]agent.Cluster, error)

func (*Clusterer) NeedsVectors

func (*Clusterer) NeedsVectors() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL