Skip to main content

URI-ABD: Clustered Learning of Approximate Manifolds

Installation

python3 -m pip install pyclam

Usage

import numpy as np

from pyclam.datasets import bullseye
from pyclam.manifold import Manifold
from pyclam import criterion

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

manifold = Manifold(data=data, metric='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), criterion.MinRadius(0.25))
# Manifold.build can optionally take any number of early stopping 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.

# A sample rho-nearest neighbors search query
query, radius = data[0], 0.05
results = manifold.find_points(point=query, radius=radius)
# results is a dictionary of indexes of hits in data and the distance to those hits.

# A sample k-nearest neighbors search query
results = manifold.find_knn(point=query, k=25)

pyclam.Manifold relies on the Graph and Cluster classes. You can import these and work with them directly if you so choose. We have written good docs for each class and method. Go crazy.

Contributing

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

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyclam-0.1.1.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyclam-0.1.1-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file pyclam-0.1.1.tar.gz.

File metadata

  • Download URL: pyclam-0.1.1.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for pyclam-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5339b1fa81c19a227e9c0810d5e1c2b8b4b95ef2efd7d476a08aa48165ceac43
MD5 e04cc051eaac24ecca591eab59667e3b
BLAKE2b-256 7139c04e3f24fb4fb0dd2ca4ff3846fbeea2b7f3e6cb63599ae30bd0c9dfb9c7

See more details on using hashes here.

File details

Details for the file pyclam-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyclam-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for pyclam-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 07d0b5e926daa751b8561cf31046dff6405509201bc927e5cfb3cc3c39a3b81e
MD5 7839025d7f0e97ff6f93630030f1addc
BLAKE2b-256 6a7432cfb69ed1a8f24231846b7bbe8918f907ba05038dbfdefeea1d4b1f0210

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page