Skip to main content

GMM Membership

gmm-membership converts posterior probabilities from one-dimensional Gaussian mixture models into ordered membership functions. It corrects tail-dominance reversals caused by components with unequal standard deviations and returns the intersections of adjacent corrected curves as cluster thresholds.

Installation

Recommended, from pip:

python -m pip install gmm-membership

Directly from GitHub:

python -m pip install git+https://github.com/YOUR_GITHUB_USERNAME/gmm-membership.git

Example

import numpy as np

from gmm_membership import build_membership_functions

parameters = np.array([
    [-2.50, 0.22, 0.08],
    [-1.60, 1.10, 0.22],
    [0.50, 0.35, 0.12],
    [2.40, 0.95, 0.22],
    [4.00, 1.20, 0.26],
    [4.80, 0.25, 0.10],
])

result = build_membership_functions(
    parameters,
    grid_min=-6.0,
    grid_max=8.8,
)

membership = result.membership_functions
thresholds = result.thresholds
new_values = result.transform(np.array([-2.6, -1.4, 0.4, 4.9]))

Main functions

build_membership_functions runs the complete correction pipeline. compute_posterior_probabilities computes smoothed GMM posterior probabilities. compute_membership_thresholds locates intersections of adjacent corrected curves. evaluate_membership_functions evaluates corrected functions for new observations. identify_active_components identifies components that dominate within their local regions. plot_gmm_density, plot_posterior_probabilities, and plot_membership_functions provide publication-oriented visualizations.

Main parameters

parameters is an array with columns mean, standard_deviation, and weight. grid_min and grid_max define the evaluation interval. settings accepts a CorrectionSettings object controlling grid resolution, smoothing, search offsets, and interpolation anchors. Plotting functions accept cmap, save_path, and an optional existing Matplotlib Axes object. plot_membership_functions accepts show_thresholds=True to display cluster boundaries.

Citation

Suwalska A, Polanska J. GMM-Based Expanded Feature Space as a Way to Extract Useful Information for Rare Cell Subtypes Identification in Single-Cell Mass Cytometry. International Journal of Molecular Sciences. 2023;24(18):14033. https://doi.org/10.3390/ijms241814033

Download files

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

Source Distribution

gmm_membership-0.3.0.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

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

gmm_membership-0.3.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file gmm_membership-0.3.0.tar.gz.

File metadata

  • Download URL: gmm_membership-0.3.0.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.4

File hashes

Hashes for gmm_membership-0.3.0.tar.gz
Algorithm Hash digest
SHA256 82eca9a183f6f23348b226ea65e44f60675b3f1c45227be81ed3835d2daed43d
MD5 28cacde5b2887361f0d6f152ab896b4a
BLAKE2b-256 275b883f0dd58daa6c547cbb8cde0049e44288c9c3b1dddb6da660fbf2fb624d

See more details on using hashes here.

File details

Details for the file gmm_membership-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: gmm_membership-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.4

File hashes

Hashes for gmm_membership-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e05d1d2e736875ce99bd55aa7e308ae8ef6217746a82515c4bbe2afa95a7138
MD5 585fba892b19c3b33f8ac4dfb879cd9d
BLAKE2b-256 fffb8aaf1346a8aae9e6a2a848795606e9b5f454a4677c89bb2543ec15b1ba3b

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.2

2 files

0.3.1

2 files

This release

0.3.0 This release

2 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