Skip to main content

A performant implementation of the DenStream algorithm that relies heavily on FAISS

Project description

FAISSt DenStream


A performant implementation of the DenStream algorithm that relies heavily on FAISS.

Installation

Without GPU acceleration: pip install faisst-denstream

With GPU acceleration: pip install faisst-denstream[gpu]

Basic Usage

import numpy as np

from faisst_denstream.DenStream import DenStream
from random import randint
from sys import stderr
from loguru import logger

logger.remove()
logger.add(stderr, level="INFO")

test_dataset_size = 10000
test_dataset_dim = 3
num_test_datasets = 10

# Create model
lamb = 0.05
beta = 0.5
mu = 10
epsilon = 0.5
n_init_points = int(test_dataset_size * 0.25)
stream_speed = 10

model = DenStream(lamb, mu, beta, epsilon, n_init_points, stream_speed)

# Multiple datasets to simulate fitting model to stream
X1 = np.random.normal(loc=randint(0, 10), scale=randint(1, 5), size=(10_000, 3))
X2 = np.random.normal(loc=randint(0, 10), scale=randint(1, 5), size=(10_000, 3))

# As long as model has consumed at least n_init_points points, `predict` and `fit_predict`
# can be called to get cluster labels for each point
model.fit(X1)
x1_labels = model.predict(X1)

x2_labels = model.fit_predict(X2)

Project details


Download files

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

Source Distribution

faisst_denstream-0.0.1.tar.gz (442.1 kB view details)

Uploaded Source

Built Distribution

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

faisst_denstream-0.0.1-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file faisst_denstream-0.0.1.tar.gz.

File metadata

  • Download URL: faisst_denstream-0.0.1.tar.gz
  • Upload date:
  • Size: 442.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for faisst_denstream-0.0.1.tar.gz
Algorithm Hash digest
SHA256 23794cbbb889486ee2a52655e1d2b33f5151a74efb5e3ce55a54f3dc28aa3671
MD5 e145d6d84782d6ba9d3526bdb999b8b9
BLAKE2b-256 a45300b756c40c10d61c01b31a05fbad03e5fd744b2169c098099fdda3a23aef

See more details on using hashes here.

File details

Details for the file faisst_denstream-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for faisst_denstream-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 44a20cb1f53723703e64a61194a1aa6cdfa6b8a2112fc0a7d404b0d2020573c0
MD5 020de7237e6f75b70af761f0c54c41e3
BLAKE2b-256 3a786b4f63caa1ea92c3acd2d58e9b5e0129624d909537a46ad6314d82ca9a3f

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