Metadata-Version: 2.4
Name: RepGeom
Version: 0.1.0a1
Summary: Small geometry primitives for labelled vector representations.
Project-URL: Repository, https://github.com/SheafLab/RepGeom-python
Author: SheafLab
License-Expression: MIT
License-File: LICENSE
Keywords: embeddings,geometry,nearest-neighbors,representation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# RepGeom

RepGeom is a small, dependency-free Python library for inspecting the geometry
of labelled vector representations. It checks that vectors share a dimension,
calculates distances and cosine similarities, and returns deterministic nearest
neighbors. It is intended for small in-memory collections where results should
be easy to inspect.

```python
from math import isclose

from repgeom import EmbeddingCloud

cloud = EmbeddingCloud.from_mapping({
    "cat": (1.0, 0.0),
    "dog": (0.8, 0.2),
    "tree": (0.0, 1.0),
})

assert cloud.nearest("cat", k=1) == (("dog", cloud.distance("cat", "dog")),)
assert all(isclose(actual, expected) for actual, expected in zip(cloud.centroid(), (0.6, 0.4)))
```

Results are sorted by distance, then label. Zero vectors have no cosine
similarity, and nonfinite or mismatched vectors are rejected at construction.
The package does not perform dimensionality reduction or model training.
