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 via CUDA 11: pip install faisst-denstream[gpu-cu11]

With GPU acceleration via CUDA 12: pip install faisst-denstream[gpu-cu12]

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")

# Create model
lamb = 0.05
beta = 0.5
mu = 10
epsilon = 2
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, 3), size=(1000, 2))
X2 = np.random.normal(loc=randint(0, 10), scale=randint(1, 3), size=(1000, 2))

# 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.10.tar.gz (2.2 MB 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.10-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: faisst_denstream-0.0.10.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for faisst_denstream-0.0.10.tar.gz
Algorithm Hash digest
SHA256 a5e93fb0a5628dc927c30e150b0b8314f8d30a8bb043dac1af7cdefb5d389744
MD5 ab71fb59ce26aa34d17685d3d922593d
BLAKE2b-256 ff6cc04fa3186445c25b510625eefed03f448d033f32c100fe144c3c042cfdad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for faisst_denstream-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 9cf2ee66582b1350f246c037bc437c28e5e227ff7a796b7cbda4da9acf1b6b0b
MD5 9971a38a4621862a0b27a3ede6329c9f
BLAKE2b-256 5e26943f7a53e387b407632530ac9c283bd46991b6d9487dc3f65252b7f9fb9c

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