Skip to main content

A package for group testing against symmetric distributions.

Project description

symgt

A package for group testing against symmetric distributions. Python 3.

pip install symgt

For example, to compute an optimal partition for a symmetric distribution...

import numpy as np
from symgt import models, algorithms, utils

# the representation alpha of symmetric distribution
alpha = np.array([0.5, 0.2, 0.0, 0.0, 0.0, 0.0, 0.2, 0.1, 0.0, 0.0, 0.0])
m = models.ExchangeableModel(10, alpha)
q = np.exp(m.log_q()) # the representation q of the symmetric distribution
multfn, cost = algorithms.symmetric_multfn(q) # cost is 6
intpart = utils.intpart_from_multfn(multfn) # intpart is [10]

# which differs from that computed using the IID approximation
m_iid = models.IIDModel(10, m.prevalence())
multfn_iid, _ = algorithms.symmetric_multfn(np.exp(m_iid.log_q()))
intpart_iid = utils.intpart_from_multfn(multfn_iid) # is [4, 3, 3]

utils.ECost(q, multfn) # 6
utils.ECost(q, multfn_iid) # 6.63

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

symgt-0.0.12.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

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

symgt-0.0.12-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file symgt-0.0.12.tar.gz.

File metadata

  • Download URL: symgt-0.0.12.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.6

File hashes

Hashes for symgt-0.0.12.tar.gz
Algorithm Hash digest
SHA256 7d84aba143dfc8fb9e5f5b837d3d7a741705c8e7cd29fd57eadcab6b7f06a8bd
MD5 56b33fc6ca09271d1a60ef4d6b30852d
BLAKE2b-256 c4fd88f2b152de978de971ac0e5684291a60ae0dede566b2ef94c412924ce6ac

See more details on using hashes here.

File details

Details for the file symgt-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: symgt-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.6

File hashes

Hashes for symgt-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 6f5e7d5963126d4ce499b2d6e9870ecadc20d7a5dcb1ecb66f3f72c03ecaee1d
MD5 71f59a94dda4bb491ba7569a270c19e0
BLAKE2b-256 bf14f05f825cc0091e3c437a8a72bea1c23ae3af322b5d6c802f14a6bec426b5

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