Skip to main content

URI-ABD: Clustered Learning of Approximate Manifolds

Installation

Docker

docker build -t clam .

Python

python3 -m pip install pyclam

Usage

Docker

docker run clam --help

Python Scripting

from pyclam import criterion
from pyclam import Manifold
from pyclam.search import CAKES
from tests import synthetic_datasets

# Get the data.
data, _ = synthetic_datasets.bullseye()
# data is a numpy.ndarray in this case but it could just as easily be a numpy.memmap if your data does fit in RAM.
# We used numpy memmaps for the research, though they impose file-IO costs.

search = CAKES(data, 'euclidean')
# The Search class provides the functionality described in our CHESS paper.
# TODO: Provide link to CHESS paper

search.build(max_depth=10)
# Build the search tree to depth of 10.
# This method can be called again with a higher depth, if needed.

query, radius = data[0], 0.5
rnn_results = search.rnn_search(query, radius)
# This is how we perform rho-nearest neighbors search with radius 0.5 around the query.

knn_results = search.knn_search(query, 10)
# This is how to perform k-nearest neighbors search for the 10 nearest neighbors of query.

# TODO: Provide snippets for using CHAODA

# You can also directly use the Manifold functionality provided by CLAM.

manifold = Manifold(data, 'euclidean')
# Any metric allowed by scipy's cdist function is allowed in Manifold.
# You can also define your own distance function. It will work so long as scipy allows it.

manifold.build(
    criterion.MaxDepth(20),  # build the tree to a maximum depth of 20
    criterion.MinRadius(0.25),  # clusters with radius less than 0.25 cannot be partitioned.
    criterion.Layer(6),  # use the clusters ad depth 6 to build a Graph.
    criterion.Leaves(),  # use the leaves of the tree to build another Graph.
)
# Manifold.build can optionally take any number of criteria.
# pyclam.criterion defines some criteria that we have used in research.
# You are free to define your own.
# Take a look at pyclam/criterion.py for hints of how to define custom criteria.

The Manifold class relies on the Graph and Cluster classes. You can import these and work with them directly if you so choose. The classes and methods are all very well documented. Go crazy.

Contributing

Pull requests and bug reports are welcome. For major changes, please open an issue to discuss what you would like to change.

License

MIT

Release files for pyclam 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyclam 0.8.0
File Size Uploaded
pyclam-0.8.0.tar.gz 34.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyclam 0.8.0
File Interpreter ABI Platform
pyclam-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 75.9 kB

Release files / pyclam-0.8.0.tar.gz

Download URL pyclam-0.8.0.tar.gz
Size 34.6 kB
Tags Source
SHA-256 checksum
How to use checksums
38822560f14bd2c37c9947fc4e6f2cdf3e7be71e01e08aa83cdb541ecdc7fcbb
BLAKE2b-256 checksum
How to use checksums
03712b019dfd9c43608199f483b6965d486d77d20c7bd6de6fa406c4c21f9238
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / pyclam-0.8.0-py3-none-any.whl

Download URL pyclam-0.8.0-py3-none-any.whl
Size 41.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
363cd90379d801d8011a7692d7b39c8af7b21a9a6bb2a961b4156a27132335a8
BLAKE2b-256 checksum
How to use checksums
7ba25f0c645b2cac58b4f6c2fe2b0b7ede2238e4b28f7b57c2efeae2c36c1905
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.7.0

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.11

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.13

2 release files

0.2.12

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page